Skip to content

Use TMPDIR environment variable instead of CWD#28

Merged
SeanBryan51 merged 1 commit intomasterfrom
26-pytest-temp-directory
Mar 14, 2023
Merged

Use TMPDIR environment variable instead of CWD#28
SeanBryan51 merged 1 commit intomasterfrom
26-pytest-temp-directory

Conversation

@SeanBryan51
Copy link
Copy Markdown
Collaborator

Previously, pytest fails if the command is not run from the project root directory. This change uses the TMPDIR environment variable instead of Path.cwd() so that pytest runs correctly from any directory.

Using TMPDIR has the added benefit that we won't run into permission issues if we run the tests on a central installation of benchcab.

Fixes #26

Previously, pytest fails if the command is not run from the
project root directory. This change uses the `TMPDIR`
environment variable instead of `Path.cwd()` so that pytest
runs correctly from any directory.

Using `TMPDIR` has the added benefit that we won't run into
permission issues if we run the tests on a central installation of
benchcab.

Fixes #26
@SeanBryan51 SeanBryan51 linked an issue Mar 10, 2023 that may be closed by this pull request
@SeanBryan51 SeanBryan51 requested a review from ccarouge March 10, 2023 04:24
Copy link
Copy Markdown
Member

@ccarouge ccarouge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good.

@SeanBryan51 SeanBryan51 merged commit 96db039 into master Mar 14, 2023
@SeanBryan51 SeanBryan51 deleted the 26-pytest-temp-directory branch March 14, 2023 03:55
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.

pytest temporary test directory should use __file__

2 participants