testing: fixing relation of fixture

This commit is contained in:
Jakub Jezek 2023-01-04 13:53:41 +01:00
parent 4518d57543
commit 233808f1ee
No known key found for this signature in database
GPG key ID: 730D7C02726179A7

View file

@ -95,6 +95,15 @@ class ModuleUnitTest(BaseTest):
print("Removing {}".format(tmpdir))
shutil.rmtree(tmpdir)
@pytest.fixture(scope="module")
def output_folder_url(self, download_test_data):
"""Returns location of published data, cleans it first if exists."""
path = os.path.join(download_test_data, "output")
if os.path.exists(path):
print("Purging {}".format(path))
shutil.rmtree(path)
yield path
@pytest.fixture(scope="module")
def env_var(self, monkeypatch_session, download_test_data):
"""Sets temporary env vars from json file."""
@ -249,15 +258,6 @@ class PublishTest(ModuleUnitTest):
yield "{}/{}".format(self.APP_GROUP, app_variant)
@pytest.fixture(scope="module")
def output_folder_url(self, download_test_data):
"""Returns location of published data, cleans it first if exists."""
path = os.path.join(download_test_data, "output")
if os.path.exists(path):
print("Purging {}".format(path))
shutil.rmtree(path)
yield path
@pytest.fixture(scope="module")
def app_args(self, download_test_data):
"""Returns additional application arguments from a test file.