Skip to content

Commit ded7bf4

Browse files
authored
Merge pull request #68 from Azure-Samples/playwrightwin
Try removing clear=True to fix Playwright tests on Windows
2 parents 964ee33 + 368b548 commit ded7bf4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/app-tests.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ jobs:
7676
run: python3 -m pytest -s -vv --cov --cov-fail-under=85
7777
- name: Run E2E tests with Playwright
7878
id: e2e
79-
if: runner.os != 'Windows'
8079
run: |
8180
playwright install chromium --with-deps
8281
python3 -m pytest tests/e2e.py --tracing=retain-on-failure

tests/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ def monkeypatch_session():
4343
@pytest.fixture(scope="session")
4444
def mock_session_env(monkeypatch_session):
4545
"""Mock the environment variables for testing."""
46-
with mock.patch.dict(os.environ, clear=True):
46+
# Note that this does *not* clear existing env variables by default-
47+
# we used to specify clear=True but this caused issues with Playwright tests
48+
# https://github.com/microsoft/playwright-python/issues/2506
49+
with mock.patch.dict(os.environ):
4750
# Database
4851
monkeypatch_session.setenv("POSTGRES_HOST", POSTGRES_HOST)
4952
monkeypatch_session.setenv("POSTGRES_USERNAME", POSTGRES_USERNAME)

0 commit comments

Comments
 (0)