diff --git a/.github/workflows/app-tests.yaml b/.github/workflows/app-tests.yaml index c1c14bd1..b99cc962 100755 --- a/.github/workflows/app-tests.yaml +++ b/.github/workflows/app-tests.yaml @@ -76,7 +76,6 @@ jobs: run: python3 -m pytest -s -vv --cov --cov-fail-under=85 - name: Run E2E tests with Playwright id: e2e - if: runner.os != 'Windows' run: | playwright install chromium --with-deps python3 -m pytest tests/e2e.py --tracing=retain-on-failure diff --git a/tests/conftest.py b/tests/conftest.py index 6dffdb5b..d53ee24e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -43,7 +43,10 @@ def monkeypatch_session(): @pytest.fixture(scope="session") def mock_session_env(monkeypatch_session): """Mock the environment variables for testing.""" - with mock.patch.dict(os.environ, clear=True): + # Note that this does *not* clear existing env variables by default- + # we used to specify clear=True but this caused issues with Playwright tests + # https://github.com/microsoft/playwright-python/issues/2506 + with mock.patch.dict(os.environ): # Database monkeypatch_session.setenv("POSTGRES_HOST", POSTGRES_HOST) monkeypatch_session.setenv("POSTGRES_USERNAME", POSTGRES_USERNAME)