Skip to content

Try removing clear=True to fix Playwright tests on Windows #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/app-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading