This repository has been archived by the owner on Feb 12, 2025. It is now read-only.
Modernize testing, load configurations more dynamically, use pooch #120
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.
Pull Request Checklist:
AUTHORS.md
What kind of change does this PR introduce?:
pytest
suite to prevent modified configurations from being propagated to other testspyproject.toml
with theflit-core
backend.reload_config()
function that can be used to forcibly overwrite aroocs
-like configuration on-the-flygitpython
has been removed in favour ofpooch
and registry files.modules
to the table of contents.Side effects:
roocs_utils
now supportspytest-xdist
(disabled by default).Does this PR introduce a breaking change?:
Yes and no. The configuration is essentially the same but is now loaded similarly to what is seen in
clisops
:roocs_utils.get_config()
function is called."environment"
env var is parsed to add projects to the namespace.The
pytest
suite was modifying theCONFIG
on load to include some paths to local testing data that was copied usinggitpython
. This has been replaced withpooch
registries that create testing data folders underXDG_CACHE
(or similar), and verified using sha256sum and git tags/branches for version control.This new system is almost directly copied from
clisops
, with the intention of making as minimal changes as possible so that the projects can be easily merged.I also added a
reload_config()
function that is used specifically in a handful of tests that require the modifiedROOCS_CONFIG
file. This works by removing the existing_CONFIG
(found underconfig.py
) and recreating it. Since theCONFIG
is initialized on the load ofroocs_utils
(and submodules then get that object from the top-level), if you want to set temporary configurations (such as for testing), you need to:pytest.monkeypatch.setenv
fixture).reload_config()
, setting the affected submodule's CONFIG to the result.pytest.monkeypatch.delenv
andreload_config()
)Other information:
I wish there was a way to simplify this further, but this needs to be moved into
clisops
first (#107).