Skip to content

Reformatting, cleanup, and coverage#193

Open
justinvanwinkle wants to merge 3 commits intomahmoud:masterfrom
justinvanwinkle:master
Open

Reformatting, cleanup, and coverage#193
justinvanwinkle wants to merge 3 commits intomahmoud:masterfrom
justinvanwinkle:master

Conversation

@justinvanwinkle
Copy link
Copy Markdown

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 15, 2020

Codecov Report

❌ Patch coverage is 89.13043% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.84%. Comparing base (d99ccaa) to head (6451e98).
⚠️ Report is 159 commits behind head on master.

Files with missing lines Patch % Lines
glom/cli.py 33.33% 2 Missing ⚠️
glom/matching.py 80.00% 2 Missing ⚠️
glom/test/test_mutation.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #193      +/-   ##
==========================================
- Coverage   98.93%   98.84%   -0.10%     
==========================================
  Files          26       26              
  Lines        4052     4053       +1     
  Branches      575      573       -2     
==========================================
- Hits         4009     4006       -3     
- Misses         20       24       +4     
  Partials       23       23              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Owner

@mahmoud mahmoud left a comment

Choose a reason for hiding this comment

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

I'm +0 on a few of these, +1 on most. A few things need addressing, however, like the test_basic imports. Maybe we do a separate file that's just for importing from the public API so it's clearer?

Also, while you're at it, do a fave and # pragma: no cover branches called out by codecov in the diff. If we're gonna touch a bunch of lines, might as well make sure they're either covered or explicitly uncovered.

Thanks!

Comment thread glom/test/test_match.py
return Match(Or(None, sub_schema))

assert glom(None, none_or('abc')) == None
assert glom(None, none_or('abc')) == None # noqa: E711
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
assert glom(None, none_or('abc')) == None # noqa: E711
assert glom(None, none_or('abc')) is None

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

basically, the ones related to matching have to do == bc you can't override is. But this one, pretty sure could be an is. :)

Comment thread glom/test/test_match.py

failing_checks = [({'a': {'b': 1}}, {'a': ('a', 'b', Match(str))},
'''expected type str, not int'''), # TODO: bbrepr at least, maybe include path like Check did
# TODO: bbrepr at least, maybe include path like Check did
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
# TODO: bbrepr at least, maybe include path like Check did
# TODO: maybe include path like Check did

ok_target = lambda: None

def ok_target():
return None
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
return None
return None # pragma: no cover

Comment thread glom/test/test_basic.py
from glom import glom, SKIP, STOP, Path, Inspect, Coalesce, CoalesceError, Val, Call, T, S, Invoke, Spec, Ref
from glom import Auto, Fill, Iter, A, Vars, Val, Literal, GlomError, Pipe
from glom import glom, SKIP, STOP, Inspect, Coalesce, Val, Call, T, S, Invoke, Spec, Ref
from glom import Fill, Iter, Literal, Pipe
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

ah, these imports are to ensure we don't regress the init of the module itself, I don't think we want to remove them.

Comment thread glom/test/test_basic.py
from glom.core import UP, bbformat, bbrepr

from glom import OMIT, Let, Literal # backwards compat
from glom import OMIT # backwards compat
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

same with the backwards compat ones here. they can probably move up close to the other public ones, but keep the comment.

Comment thread glom/test/test_basic.py
).star(args='args2', kwargs='kwargs')
spec = (Invoke(test).star(args='args')
.constants(3, b='b').specs(c='c')
.star(args='args2', kwargs='kwargs'))
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

this is better than the one before, but i think one per line might read nice here.

@mahmoud mahmoud changed the title tabs and spaces? Reformatting, cleanup, and coverage Aug 15, 2020
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.

2 participants