-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modernize testing, load configurations more dynamically, use pooch #120
Conversation
…encies, fail on warning
@Zeitsperre do you want to move this PR directly into |
@cehbrecht Yes, I think that would be much simpler. It would be helpful to know which modules are no longer required to be ported now that Martin's changes are in CLISOPS (is it just I'll have time to get back to this soon, but my intention here (reflecting what we talked about) was to port my changes directly into CLISOPS. |
Yes ... I think so ... Martin integrated |
The work here has been rendered obsolete. Closing. |
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).