test: project scope fixtures for repo root and data dir #572
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.
This is a proof of concept solution to #570. For this to work, this will require running tests with
pytest
. In short, this exposes the repo root and data directory paths aspytest
fixtures that can be utilized bypytest
style tests andunittest.UnitTest
tests. Theunittest
fixture variants set private properties onunittest.UnitTest
instances.Example of adding this functionality to a
unittest.UnitTest
:For those who have not been indoctrinated, here are a few links that will be helpful to understand
pytest
s integration withunittest
, the concept of a fixture, and fixture scopes.edit: fixed link to the description / diagram of fixture scopes