Skip to content

fix: use native path format for pytest subprocess args on Windows#2138

Merged
KRRT7 merged 1 commit intofix/test-files-silent-dedupfrom
fix/windows-junitxml-path
May 8, 2026
Merged

fix: use native path format for pytest subprocess args on Windows#2138
KRRT7 merged 1 commit intofix/test-files-silent-dedupfrom
fix/windows-junitxml-path

Conversation

@KRRT7
Copy link
Copy Markdown
Collaborator

@KRRT7 KRRT7 commented May 7, 2026

Summary

  • Removes .as_posix() from --junitxml and --rcfile subprocess arguments in PythonSupport test runners
  • On Windows, .as_posix() produces mixed-format paths (C:/Users/...) that pytest's XML writer can't handle
  • Fixes flaky test_run_and_parse_picklepatch failure on Windows CI
  • Fixes 10 pre-existing mypy errors in support.py (bare generics, re-export issues, missing attribute guards)

Test plan

  • test_run_and_parse_picklepatch passes locally (macOS — no-op since str(PosixPath) already uses /)
  • Windows CI passes (the actual fix target)
  • mypy clean: uv run mypy codeflash/languages/python/support.py → 0 errors
  • ruff check + format pass

@KRRT7 KRRT7 force-pushed the fix/windows-junitxml-path branch 2 times, most recently from 9babf0a to 7f5f229 Compare May 7, 2026 16:47
@KRRT7 KRRT7 changed the base branch from main to fix/test-files-silent-dedup May 7, 2026 16:49
@KRRT7 KRRT7 force-pushed the fix/test-files-silent-dedup branch from 9459c5a to 46f63d2 Compare May 7, 2026 16:50
@KRRT7 KRRT7 force-pushed the fix/windows-junitxml-path branch from 7f5f229 to 38c2445 Compare May 7, 2026 16:50
@KRRT7 KRRT7 force-pushed the fix/test-files-silent-dedup branch from 46f63d2 to 72b75d6 Compare May 7, 2026 17:28
@KRRT7 KRRT7 force-pushed the fix/windows-junitxml-path branch from 38c2445 to 3e83a5c Compare May 7, 2026 17:30
@KRRT7 KRRT7 force-pushed the fix/test-files-silent-dedup branch from 72b75d6 to 5208de8 Compare May 7, 2026 17:42
@KRRT7 KRRT7 force-pushed the fix/windows-junitxml-path branch from 3e83a5c to 1728cd4 Compare May 7, 2026 17:42
- Remove .as_posix() from --junitxml and --rcfile subprocess arguments;
  use native path format (str(path)) which works on all platforms.

- Replace get_cross_platform_subprocess_run_args() in
  execute_test_subprocess with plain subprocess.run(capture_output=True,
  close_fds=False). The Windows-specific CREATE_NEW_PROCESS_GROUP and
  stdin=DEVNULL flags caused pytest to sporadically fail to write its
  junitxml output file, resulting in flaky test_pickle_patcher failures.
  Matches the working implementation in codeflash-python.

- Fix 10 pre-existing mypy errors in support.py (bare generics,
  re-export issues, missing attribute guards).
@KRRT7 KRRT7 force-pushed the fix/test-files-silent-dedup branch from c58d349 to 50f5070 Compare May 7, 2026 22:47
@KRRT7 KRRT7 force-pushed the fix/windows-junitxml-path branch from 1728cd4 to aa98bc1 Compare May 7, 2026 22:47
@KRRT7 KRRT7 marked this pull request as draft May 7, 2026 22:53
@KRRT7 KRRT7 marked this pull request as ready for review May 8, 2026 00:08
@KRRT7 KRRT7 merged commit 7c61881 into fix/test-files-silent-dedup May 8, 2026
32 of 33 checks passed
@KRRT7 KRRT7 deleted the fix/windows-junitxml-path branch May 8, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant