Skip to content

Tests fail on Windows: POSIX inline env-var syntax (PYTHONPATH=...) not portable #31

Description

@DataDave-Dev

Problem

Three tests pass the environment to a subprocess using POSIX inline syntax (PYTHONPATH=... <command>). PowerShell and cmd do not understand this form, so the subprocess runs without PYTHONPATH set and the tests fail.

Running the full suite on Windows yields:

116 passed, 1 skipped, 3 failed

On POSIX (Linux/macOS) the suite is fully green (124 passed), so this is a test-portability issue, not a defect in becwright itself.

Where it was observed

Surfaced while reviewing PR #30. The PR's own changes are unrelated to the failures; they are pre-existing.

Suggested fix

Stop injecting the variable on the command line. Instead pass the environment explicitly to the subprocess, e.g.:

  • build an env dict and pass it via subprocess.run(..., env=env), or
  • use monkeypatch.setenv("PYTHONPATH", ...) before spawning,

so the tests run identically on POSIX and Windows shells.

Scope

Test-only change. No change to the engine, rules format, or check logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions