Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reach 100% coverage #31

Merged
merged 28 commits into from
Sep 22, 2017
Merged

Reach 100% coverage #31

merged 28 commits into from
Sep 22, 2017

Conversation

jamadden
Copy link
Member

Fixes #16.

Opening now so reviewers can start reviewing. There's still one function in internalization.py to complete.

There are a bunch of individual commits here. I try to keep it to one file per commit (roughly). It may be easier to review that way. There are very few semantic changes, but there are a very few corner cases that are handled differently...I don't expect them to be any issue. When there was one like that, I tried to call it out in the commit note (look for the ellipsis).

…nager when we have (and are testing with) a perfectly good implementation already.
Fix WithRepr when passed a default repr function.

Make the generated repr function handle more errors and provide the
full class name.
…tastructers.py

Note that AbstractDynamicObjectIO had an uncovered branch in
updateFromExternalObject where it wanted to set the creator property,
but it had the internal and external field names confused. (It tried
to get and set the external id on the internal object.) That was fixed.
- Remove weird legacy behaviour that caught a POSError coming from
  a *module*. How on Earth...?
- Simplify implementation.
The implementation was dramatically simplified and sped up. The previous
complicated behaviour of manually checking sys.modules is gone,
replaced with just resolve. And the hiding of import errors is gone,
since that indicates a programming error that needs to be fixed.
…d_object_factory_finder

Note that the corner case of {'Class': ''} which could previously find
a default adapter or utility is no longer supported. There was a
lurking bug here if it was {'Class': None}. We shouldn't have any such
adapter or utility anyway.
Speed up the __external_resolvers__ branch for instance functions by a
lot.
@jamadden jamadden changed the title [WIP] Reach 100% coverage [Reach 100% coverage Sep 21, 2017
@jamadden jamadden changed the title [Reach 100% coverage Reach 100% coverage Sep 21, 2017
@jamadden
Copy link
Member Author

OK, we've hit 100% coverage (line, not branch; I did best-effort with branch coverage for now). Ready for serious review.

Copy link
Contributor

@papachoco papachoco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM .. for this pass we will not have a hookable for the get_current request?

@jamadden
Copy link
Member Author

jamadden commented Sep 22, 2017

for this pass we will not have a hookable for the get_current request?

Separate issue, separate PR my man. It's a best practice to try to keep commits and PRs as focused on a single issue as possible. Or, as ESR says "To do large code changes correctly, factor them into a series of smaller steps such that each revision has a well-defined and provable relationship to the last." (That's one reason that I don't like squashing commits on merge unless they are trivial.)

@jamadden jamadden merged commit 285f859 into master Sep 22, 2017
@jamadden jamadden deleted the issue16 branch September 22, 2017 09:56
@papachoco papachoco restored the issue16 branch September 22, 2017 15:05
@@ -417,8 +416,8 @@ def choose_field(result, self, ext_name,

if value is not None:
# If the creator is the system user, catch it here
if ext_name is StandardExternalFields_CREATOR and is_system_user(value):
value = to_unicode(SYSTEM_USER_NAME)
if ext_name == StandardExternalFields_CREATOR and is_system_user(value):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'is' with strings is tricky on PyPy. They don't guarantee identity in the same way CPython does.

@jamadden jamadden mentioned this pull request Sep 22, 2017
@papachoco papachoco deleted the issue16 branch September 23, 2017 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants