From fdb7c1c38002c4289a4221888c28c538780a4d65 Mon Sep 17 00:00:00 2001 From: niksirbi Date: Fri, 14 Jul 2023 15:52:49 +0100 Subject: [PATCH] moved sample_project fixture to conftest.py --- tests/test_unit/conftest.py | 11 +++++++++++ tests/test_unit/test_utils.py | 9 --------- 2 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 tests/test_unit/conftest.py diff --git a/tests/test_unit/conftest.py b/tests/test_unit/conftest.py new file mode 100644 index 0000000..a5fb66e --- /dev/null +++ b/tests/test_unit/conftest.py @@ -0,0 +1,11 @@ +from pathlib import Path + +import pytest + +from wazp.datasets import get_sample_project + + +@pytest.fixture() +def sample_project() -> Path: + """Get the sample project for testing.""" + return get_sample_project("jewel-wasp", "short-clips_compressed", progressbar=True) diff --git a/tests/test_unit/test_utils.py b/tests/test_unit/test_utils.py index 37fea2e..e57c159 100644 --- a/tests/test_unit/test_utils.py +++ b/tests/test_unit/test_utils.py @@ -1,21 +1,12 @@ import glob import tempfile -from pathlib import Path import pytest import yaml -from wazp.datasets import get_sample_project from wazp.utils import df_from_metadata_yaml_files -# Pytest fixture for getting a sample project -@pytest.fixture(scope="session") -def sample_project() -> Path: - """Get the sample project for testing.""" - return get_sample_project("jewel-wasp", "short-clips_compressed", progressbar=True) - - @pytest.fixture def metadata_fields(sample_project) -> dict: """Get the metadata dictionary from the sample project for testing."""