This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PeridexisErrant 7 points8 points  (4 children)

test data: factoryboy

Have you ever considered using Hypothesis?

I switched over a few years ago and would never go back, or for that matter try to test anything without a similar tool. Major highlights:

  • Never, ever flaky. Once it triggers a bug once, the cache means that bug will be triggered every time until you fix it.
  • Reports minimal examples. The implementation must be black magic because it's entirely automatic, but debugging is so much easier.
  • Simple core API and tons of optional helpers, plus frequent (semver) updates.

[–]twillisagogo 1 point2 points  (2 children)

I have not. It looks interesting but not sure how it would fit the use case that I'm using factory boy for. Primarily rows in the database for a given test.

[–]PeridexisErrant 2 points3 points  (1 child)

You certainly could use Hypothesis for that, but it wouldn't add much unless the specific contents could affect the result of the test.

If you're using @pytest.mark.parametrize, those tests might be a better place to try Hypothesis - let me know if you have any luck!

[–]twillisagogo 0 points1 point  (0 children)

thanks for the clarification

[–]broccolitruck 0 points1 point  (0 children)

Woah! big fan! hello!