Change directory more safely in unit tests #51
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A slight improvement over the previous system since we now save the starting directory in
setUp
and return to it intearDown
. Previously, we didchdir('../..')
intearDown
, which could go wrong if something unexpected happened insetUp
or if an extrachdir()
was used in the test functions themselves.Some improvements that could be added here or in a future PR
examples/
andworkspace/
directories to the test utils module and making themFinal
.run_psql()
presumes that it is being called from the repo root directory. This doesn't feel good as it then matters which order you do thesetUp
calls in. Is there a way we can remove this reliance on the current working directory to run the db setup scripts with psql?