-
Notifications
You must be signed in to change notification settings - Fork 523
%b-%Y-%d #441
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
%b-%Y-%d #441
Conversation
… parametrized tests Adjust tox.ini and .gitignore accordingly
…parametrized Fix resolve_ymd for case that fails under new tests
|
@jbrockmendel I would say that there's no reason to break Anyway, the CI is broken because I think you need to add a |
dateutil/test/test_parser.py
Outdated
| token_opts = [['%Y'], ['%b', '%B'], ['%d', '%-d']] | ||
|
|
||
| prods = itertools.product(*token_opts) | ||
| perms = [y for x in prods for y in itertools.permutations(x)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is more readable per se, but I believe this is equivalent to:
list(itertools.chain.from_iterable(map(itertools.permutations, itertools.prod(*token_opts))))
or possibly better:
list(itertools.chain(*(itertools.permutations(x) for x in itertools.prod(*token_opts))))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the two-line version more readable, but am pretty close to indifferent on this.
|
pytest doesn't allow for yield-based tests, right? I tried having this test run for (much) more than just 2003-09-25 and it looks like it created the tests as a list rather than a generator. |
|
I can't reproduce this test failure on my local machine with Python 3.4 on Linux. Is this a travis thing? |
|
The Travis errors look like they are coming from |
|
Yeah, that was what I figured, but I'm not sure what because my machine doesn't do it when I spin up a Python 3.4 conda environment. I was thinking I'd maybe try removing the profiling stuff, then the coverage stuff sequentially and see if either of those fixes it, at least to narrow it down. |
|
I just pushed a commit that uses regular nose-style tests instead of pytest. We'll see if that was the issue with the Travis error. |
|
@jbrockmendel What was it you changed that fixed this? I just found out about debug mode on TravisCI, so I was thinking I'd try and debug it that way. |
|
I just removed pytest and changed the new test to yield nose-style. |
|
@jbrockmendel I'll try and look at this in more detail this weekend, I'm not sure I understand how these |
|
I think you're right that I didn't completely remove |
|
I'd like to wrap up at least the bug-fix part of this. Is the pytest problem still a problem? If so, I'll make a new PR that uses the older test setup. |
|
This is the most infuriating thing. I managed to open an interactive shell, but I still can't replicate the problem. Anyway, yeah, I think just drop both all the pytest stuff including the yield tests. Switch that from using |
|
Superceded by #481 |
Apparently all the cool kids are transitioning to pytest. To get a feel for it I took a few of the more easily-parametrized cases from test_parser.py and implemented them in test_parser_parametrized.py. Explicitly looping over all the valid formats exposed a handful that are not currently handled correctly (and clearly, not currently tested). Namely:
This happens because
resolve_ymdnever considers the possibility (month, year, day). This PR adds that particular check.