-
Notifications
You must be signed in to change notification settings - Fork 166
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
Killed unit tests can leave a sample_project folder in the top-level folder #589
Comments
This never happens in Linux because in Linux, the leftover We should update I think |
@lieryan Another alternative: add |
Fix #589 Cleanup testutils.sample_project()
This should now be fixed in #596, @edreamleo would you be able to test this on Windows? |
@lieryan Thanks! |
@lieryan I ran and interrupted pytest several times on Windows. The sample_project folder never persisted. But this doesn't seem like much of a test :-) Do you have any ideas about how to strengthen the test? |
Thanks. That should be good enough. Just keep an eye and report back if the issues ever returns. |
@lieryan will do. |
This has happened several times, but my notes don't tell me how to reproduce the bug.
Hmm. I bet I know what happened. I probably killed the console running the tests, thereby randomly preventing a
tearDown
method from executing.testutils.sample_project
special-cases posix platforms. Perhaps this bug only bites on Windows. Or perhaps projects could be created in a tmp folder.Investigation shows that many
setUp
andtearDown
methods create and destroy thesample_projects
folder. It's non-trivial to verify that eachtearDown
method destroys the folder created bysetUp
.So it might be safer to define a
ProjectTestCase
class whosesetUp
andtearDown
methods calltestutils.sample_project
andtestutils.remove_project
respectively. Subclasses would then be free of managing the project folder themselves.The text was updated successfully, but these errors were encountered: