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

Add timedeltas strategy to datetime extra #333

Closed
Daenyth opened this issue Jun 9, 2016 · 3 comments · Fixed by #621
Closed

Add timedeltas strategy to datetime extra #333

Daenyth opened this issue Jun 9, 2016 · 3 comments · Fixed by #621
Assignees
Labels
enhancement it's not broken, but we want it to be better

Comments

@Daenyth
Copy link

Daenyth commented Jun 9, 2016

It seems appropriate.

malinoff added a commit to malinoff/hypothesis-python that referenced this issue Aug 9, 2016
@Zac-HD
Copy link
Member

Zac-HD commented Apr 14, 2017

@malinoff, @NotBobTheBuilder, do either of you want to finish up your pulls? If not, I can try integrating the implementation from #441 with the tests and docs from #352 so you both get appropriate credit.

@NotBobTheBuilder
Copy link

Sure - what needs finishing on mine?

@Zac-HD
Copy link
Member

Zac-HD commented Apr 15, 2017

I've basically outlined it in #520, where I pulled in some tests and extra docs from @malinoff's implementation.

  • git pull https://github.com/Zac-HD/hypothesis-python.git timedelta-strategies to get the merged version. I've inlined the validation logic, to avoid adding new functions to the namespace which resemble incompatible things, and fixed a few linting issues.
  • Remove test_can_find_zero_delta, as it's a poor duplicate of test_simplifies_towards_zero_delta
  • Change the generation strategy so that timedeltas shrink towards 0, preferring positive values. If they already do, check that the tests are working (see my travis build). Note in the documentation that timedelta normalisation means this will give some unintuitive results (eg timedelta(microseconds=-1) looks pretty scary).
  • Ensure that the tests have complete code coverage; this usually just means passing invalid inputs so that all the validation logic gets exercised. If it's anything more complicated, I'd be happy to help out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement it's not broken, but we want it to be better
Projects
None yet
3 participants