Tricky problem in python unit/sys testing regarding temporary directories
- Dominant language
- Fortran
- Stars
- 352
- Forks
- 361
- Avg merge
- 6d 6h
- Merged PRs (30d)
- 8
Description
### Brief summary of bug
This is a problem we keep running into with our python testing. Some of the tests have the Setup method create a temporary directory that is then destroyed at the TearDown step. The problem happens if the current working directory is the directory that is destroyed. The test that does this actually works fine.
But, if the next test stays in that directory (that is now gone) and tries to do anything -- weird system errors occur. And that next test fails -- but NOT do to anything in that test. It's all an artifact of the previous test. And since successful tests don't show any output you don't have any information on the test that causes the problem. Then you try to find non existing problems in the test that fails -- but since there isn't any problem there you don't find any. And it becomes frustrating.
Here's some example commits that deal with this:
747eda6755d4738b1555e010a145a9bbad3e69cb
0b066bee71e80cbc7b7d164c0d862ed5cb9b9af1
I know I've done work on this as well.
Contributor guide
Assessment
This issue has not been assessed yet.