Skip to content

Always reset pytest working directory to invocation dir#4384

Open
timothy-nunn wants to merge 1 commit into
mainfrom
pytest-reset-working-dir
Open

Always reset pytest working directory to invocation dir#4384
timothy-nunn wants to merge 1 commit into
mainfrom
pytest-reset-working-dir

Conversation

@timothy-nunn

@timothy-nunn timothy-nunn commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Getting the cwd within the return_to_root fixture was prone to error when another fixture ran first and changed the working directory. I have set the fixture now to return the working directory to the invocation directory (where the user called pytest from).

This issue manifests as an error 128 from the git subprocess when running just pytest

@codecov-commenter

codecov-commenter commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.84%. Comparing base (a3db864) to head (04cda95).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4384   +/-   ##
=======================================
  Coverage   48.84%   48.84%           
=======================================
  Files         151      151           
  Lines       29406    29406           
=======================================
  Hits        14363    14363           
  Misses      15043    15043           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timothy-nunn timothy-nunn marked this pull request as ready for review June 25, 2026 09:47
@timothy-nunn timothy-nunn requested a review from a team as a code owner June 25, 2026 09:47
@timothy-nunn timothy-nunn force-pushed the pytest-reset-working-dir branch from bea4193 to 04cda95 Compare July 7, 2026 13:56
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.

3 participants