From 161d02cd98f7a3f8f8177084a9d37aa8774d644d Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Fri, 10 May 2024 16:36:14 +0200 Subject: [PATCH] Use python -m to run pytest --- .github/workflows/test_linux.yml | 2 +- .github/workflows/test_mac.yml | 2 +- .github/workflows/test_win.yml | 2 +- tests/conftest.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index a7228a08..9112966e 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -36,7 +36,7 @@ jobs: - name: Run Tests run: | export QT_QPA_PLATFORM=offscreen - pytest -v --cov=novelwriter --timeout=60 + python -m pytest -v --cov=novelwriter --timeout=60 - name: Upload to Codecov uses: codecov/codecov-action@v4 env: diff --git a/.github/workflows/test_mac.yml b/.github/workflows/test_mac.yml index 64c3dfa8..0d968ab3 100644 --- a/.github/workflows/test_mac.yml +++ b/.github/workflows/test_mac.yml @@ -30,7 +30,7 @@ jobs: - name: Run Tests run: | export QT_QPA_PLATFORM=offscreen - pytest -v --cov=novelwriter --timeout=60 + python -m pytest -v --cov=novelwriter --timeout=60 - name: Upload to Codecov uses: codecov/codecov-action@v4 env: diff --git a/.github/workflows/test_win.yml b/.github/workflows/test_win.yml index 9cb28ba0..afecc017 100644 --- a/.github/workflows/test_win.yml +++ b/.github/workflows/test_win.yml @@ -26,7 +26,7 @@ jobs: pip install -U -r requirements.txt -r tests/requirements.txt - name: Run Tests run: | - pytest -v --cov=novelwriter --timeout=60 + python -m pytest -v --cov=novelwriter --timeout=60 - name: Upload to Codecov uses: codecov/codecov-action@v4 env: diff --git a/tests/conftest.py b/tests/conftest.py index 6b95d569..1e463f9c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -30,13 +30,13 @@ import pytest from PyQt5.QtWidgets import QMessageBox -from tests.mocked import MockGuiMain, MockTheme -from tests.tools import cleanProject - sys.path.insert(1, str(Path(__file__).parent.parent.absolute())) from novelwriter import CONFIG, SHARED, main # noqa: E402 +from tests.mocked import MockGuiMain, MockTheme # noqa: E402 +from tests.tools import cleanProject # noqa: E402 + _TST_ROOT = Path(__file__).parent _TMP_ROOT = _TST_ROOT / "temp" _TMP_CONF = _TMP_ROOT / "conf"