Ensure all produced files from tests are in a temp dir #239
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.
Description:
Closes #220.
Add pytest fixtures for loading EMMO, as this is done in several tests.
Add fixture for location to repo_dir, instantiating it only once per pytest session.
Add a yield-fixture for creating a temporary directory that lives for the lifetime of the test function.
This removes the possibility to check through the generated files from the tests, keeping the unit tests being just that: unit tests.
However, I guess the generated files should be tested more now?
In short, the unit tests here should never rely on human inspection, hence, they shouldn't produce any permanent files.
If examples are the motive for the tests (as it is explicitly stated for one of them) it should be added to the
examples/
folder and be part of the documentation.Type of change:
Checklist:
This checklist can be used as a help for the reviewer.
Comments:
This partly closes the issue, since the tests should still be further tidied.