-
Notifications
You must be signed in to change notification settings - Fork 588
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
Use tmp_path in ghostwriter tests #4050
Use tmp_path in ghostwriter tests #4050
Conversation
b381394
to
2762b7e
Compare
Most of the failures seem to be random flakiness (which maybe is not great considering I keep telling people "Oh hypothesis doesn't make your test suite flaky!"), but there's this lint rule that seems... odd:
Is that a real thing that you actually want addressed? I have never heard of this convention before. It doesn't seem to be in evidence in the Edit Seems like at least one |
Before creating the temporary functions, moves the local directory to a clean temporary directory; this should guarantee that the files to be created don't exist, and handles cleanup automatically. This also works when the local directory that the tests are executed from is not writable, but the temporary directory is.
2762b7e
to
769f575
Compare
As a test-only change, this doesn't need to be released, and we can simply ignore the (bad) lint rule.
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.
Thanks Paul! I've just disabled that lint rule, and stacked in some other small test fixes that I had in a branch - merging now 🙂
Well, most people aren't writing a large number of tests like "the default strategy will always generate $specific_edge_case", or "if you do $thing you get a health-check failure"; we're pushing hard enough to hit a lot of nondeterministic or timing-dependent edge cases, and with the backend evolving (#3921) we haven't finished shaking out all the flakes yet 😞 |
Before creating the temporary functions, moves the local directory to a clean temporary directory; this should guarantee that the files to be created don't exist, and handles cleanup automatically.
This also works when the local directory that the tests are executed from is not writable, but the temporary directory is.
I have tested that the way fixture resolution works, it seems that
in_temp_file
will only be executed once if you include both of the file-creating fixtures.