Skip to content

Commit 9db0a39

Browse files
committed
Move original_datadir fixture into testing.py
1 parent 33c1db1 commit 9db0a39

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

domdf_python_tools/testing.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
# stdlib
3232
import datetime
3333
import itertools
34+
import os
3435
import random
3536
import sys
3637
from functools import lru_cache
@@ -391,6 +392,12 @@ def my_test(tmp_pathplus: PathPlus):
391392
return PathPlus(tmp_path)
392393

393394

395+
@pytest.fixture()
396+
def original_datadir(request) -> Path:
397+
# Work around pycharm confusing datadir with test file.
398+
return Path(os.path.splitext(request.module.__file__)[0] + '_')
399+
400+
394401
def pytest_report_header(config, startdir):
395402
"""
396403
Prints the start time of the pytest session.

tests/conftest.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1 @@
1-
# stdlib
2-
import os
3-
from pathlib import Path
4-
5-
# 3rd party
6-
import pytest
7-
81
pytest_plugins = ("domdf_python_tools.testing", )
9-
10-
11-
@pytest.fixture()
12-
def original_datadir(request) -> Path:
13-
# Work around pycharm confusing datadir with test file.
14-
return Path(os.path.splitext(request.module.__file__)[0] + '_')

0 commit comments

Comments
 (0)