Skip to content

Commit 19ce8e9

Browse files
committed
feat: pytest
1 parent d572b2d commit 19ce8e9

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

.github/workflows/codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ jobs:
3535
- name: Generate Report
3636
run: |
3737
pip install -r tests/requirements/${{ matrix.requirements-file }}
38-
coverage run run_tests.py
38+
coverage run -m pytest
3939
- name: Upload Coverage to Codecov
4040
uses: codecov/codecov-action@v4

run_tests.py renamed to conftest.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
from django.test.utils import get_runner
88

99

10-
def run(argv=None):
11-
if argv is None:
12-
argv = ["tests"]
13-
tests = argv[1:] if len(argv) > 1 else ["tests"]
10+
def pytest_configure():
1411
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.test_settings"
1512
django.setup()
13+
14+
15+
if __name__ == "__main__":
16+
pytest_configure()
17+
18+
argv = ["tests"] if sys.argv is None else sys.argv
19+
tests = argv[1:] if len(argv) > 1 else ["tests"]
1620
TestRunner = get_runner(settings)
1721
test_runner = TestRunner()
1822
failures = test_runner.run_tests(tests)
1923
sys.exit(bool(failures))
20-
21-
22-
if __name__ == "__main__":
23-
run(sys.argv)

0 commit comments

Comments
 (0)