Skip to content

Commit 5195202

Browse files
committed
add shared var for both pytest.fixture
1 parent 86d0a0c commit 5195202

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

tests/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
# Local application imports
99
from app import app
1010

11+
TEST_ID = "1"
12+
1113

1214
@pytest.fixture(scope="session", autouse=True)
1315
def copy_data():
1416
shutil.rmtree("./data", ignore_errors=True)
15-
shutil.copytree("./tests/data/", "./data/1/", dirs_exist_ok=True)
17+
shutil.copytree("./tests/data/", f"./data/{TEST_ID}/", dirs_exist_ok=True)
1618

1719

1820
@pytest.fixture
@@ -35,4 +37,4 @@ def app_context():
3537

3638
@pytest.fixture
3739
def test_id():
38-
return "1"
40+
return TEST_ID

tests/test_routes.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,6 @@ def get_full_data():
304304
# Test all params
305305
test_utils.test_route_wrong_params(client, route, get_full_data)
306306

307-
# Test all params
308-
test_utils.test_route_wrong_params(client, route, get_full_data)
309-
310307

311308
def test_create_point(client):
312309
route = f"/create_point"

0 commit comments

Comments
 (0)