Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 'getoption' to get the basetemp value instead of private details #519

Closed
wants to merge 1 commit into from
Closed

Use 'getoption' to get the basetemp value instead of private details #519

wants to merge 1 commit into from

Conversation

BenjaminSchubert
Copy link

@BenjaminSchubert BenjaminSchubert commented Apr 3, 2020

pytest-dev/pytest#6767 has removed the _tmpdirhandler that was used to get the base temporary directory.

This now reads the path to the base temporary directory directly
from pytest configuration.

Fix #518


Here's a quick checklist that should be present in PRs:

  • Make sure to include reasonable tests for your change if necessary

  • We use towncrier for changelog management, so please add a news file into the changelog folder following these guidelines:

    • Name it $issue_id.$type for example 588.bugfix;

    • If you don't have an issue_id change it to the PR id after creating it

    • Ensure type is one of removal, feature, bugfix, vendor, doc or trivial

    • Make sure to use full sentences with correct case and punctuation, for example:

      Fix issue with non-ascii contents in doctest text files.
      

pytest-dev/pytest#6767 has removed the
`_tmpdirhandler` that was used to get the base temporary directory.

This now reads the path to the base temporary directory directly
from pytest configuration.
if hasattr(self.config, "_tmpdirhandler"):
basetemp = self.config._tmpdirhandler.getbasetemp()
option_dict["basetemp"] = str(basetemp.join(name))
basetemp = self.config.getoption("basetemp")
Copy link
Member

Choose a reason for hiding this comment

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

this only fixes half of the problem, pytest will undo the removal of _tmpdirhandler until we come up with a good full solution

Copy link
Author

Choose a reason for hiding this comment

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

Oh, did I miss the issue which contained those information? What is the other half?

Thanks for the quick response!

Copy link
Author

Choose a reason for hiding this comment

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

Ah, found it: #510. I'll close this unless I get more guidance for the other part of the solution.

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-cov doesn't respect --basetemp with pytest 5.4.0+
2 participants