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

Increase Test coverage for IsoParser to 100% and Pep8 #743

Closed
wants to merge 7 commits into from

Conversation

alimcmaster1
Copy link
Contributor

Summary of changes

Increase test coverage of IsoParser to 100% and PEP8

Closes <#521>

Created separate branch for my test coverage changes, so they can be reviewed/merged seperately
('2014_W01-1', ValueError), # Invalid separator
('2014W01-1', ValueError), # Inconsistent use of dashes
('2014-W011', ValueError), # Inconsistent use of dashes
('201', ValueError), # ISO string too short
Copy link
Member

Choose a reason for hiding this comment

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

I prefer the original comment alignment. PEP 8 does not require them to not be aligned.

@@ -274,7 +312,7 @@ def test_iso_raises_sep(sep_act, valid_sep):

@pytest.mark.xfail()
@pytest.mark.parametrize('isostr,exception', [
('20120425T01:2000', ValueError), # Inconsistent time separators
('20120425T01:2000', ValueError), # Inconsistent time separators
Copy link
Member

Choose a reason for hiding this comment

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

Another change to revert.

@@ -283,7 +321,6 @@ def test_iso_raises_failing(isostr, exception):
isoparse(isostr)


###
Copy link
Member

Choose a reason for hiding this comment

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

Don't delete these "header" comments.

Copy link
Contributor

Choose a reason for hiding this comment

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

The pep8-compliant way to do this I've seen elsewhere is # --------------------------------------

@pganssle
Copy link
Member

pganssle commented Jun 8, 2018

  1. I would prefer if large-scale formatting changes were submitted in a separate commit from actual content
  2. Most of these changes are not for PEP 8 compliance and actually make this file harder to read. Please don't change the alignment of the comments or the ### "header" comments.

@alimcmaster1
Copy link
Contributor Author

Sure, thanks for the feedback, you want me to resubmit with just the test case? If desired I can keep the PEP8 fixes and remove my changes that touched comment spacing and ### headers.

@pganssle
Copy link
Member

pganssle commented Jun 8, 2018

@alimcmaster1 Doesn't have to be resubmitted, but whatever's easiest, just as long as the PEP 8 changes are in a separate commit from the substantive changes. You can rewrite the history and use git push --force if you need to.

TZOFFSETS)))
((None, time(0), None),) + tuple(('%H:%M:%S.%f', _t, _tz)
for _t, _tz in
it.product([time(0), time(9, 30), time(14, 47)], TZOFFSETS)))
Copy link
Contributor

Choose a reason for hiding this comment

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

wont pep8 complain about a long line here (E501 I think)?

])
def test_isotime_raises_xfail(isostr, exception):
iparser = isoparser()
with pytest.raises(exception):
iparser.parse_isotime(isostr)
iparser.parse_isotime(isostr)
Copy link
Contributor

Choose a reason for hiding this comment

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

pep8 complaint about missing '\n' at end of file

@alimcmaster1
Copy link
Contributor Author

Thanks both for the feedback. Since <#745> seems to be discussing styling in general in the project I will leave my pep8 changes for now. Have revert and just submitted the additional test case I added.

What do you think?

@alimcmaster1
Copy link
Contributor Author

Will raise a new PR with no formatting changes etc

@alimcmaster1 alimcmaster1 deleted the test-coverage branch June 19, 2018 23:47
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.

3 participants