diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 19:54:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 19:58:39 +0000 |
commit | 129a1fb4dbc375be0fa926964aa1be46a0cdbbef (patch) | |
tree | 04c0088df47415b24a5be1325d3656b8c3881c04 /tests/plugin_tests/conftest.py | |
parent | Initial commit. (diff) | |
download | debputy-129a1fb4dbc375be0fa926964aa1be46a0cdbbef.tar.xz debputy-129a1fb4dbc375be0fa926964aa1be46a0cdbbef.zip |
Adding upstream version 0.1.21.upstream/0.1.21
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/plugin_tests/conftest.py')
-rw-r--r-- | tests/plugin_tests/conftest.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/plugin_tests/conftest.py b/tests/plugin_tests/conftest.py new file mode 100644 index 0000000..f2a8aea --- /dev/null +++ b/tests/plugin_tests/conftest.py @@ -0,0 +1,20 @@ +import os + +import pytest + + +@pytest.fixture(autouse=True) +def workaround_debputys_own_test_suite() -> None: + # This fixture is only required as long as the tests are run inside `debputy`'s + # own test suite. If you copy out a plugin + tests, you should *not* need this + # fixture. + # + # The problem appears because in the debputy source package, these plugins are + # always provided in their "installed" location. + orig = os.environ.get("DEBPUTY_TEST_PLUGIN_LOCATION") + os.environ["DEBPUTY_TEST_PLUGIN_LOCATION"] = "installed" + yield + if orig is None: + del os.environ["DEBPUTY_TEST_PLUGIN_LOCATION"] + else: + os.environ["DEBPUTY_TEST_PLUGIN_LOCATION"] = orig |