Skip to content

Commit

Permalink
Use internal version of make_numbered_dir
Browse files Browse the repository at this point in the history
(cherry picked from commit 678440e)

Conflicts:
	src/_pytest/pytester/__init__.py
  • Loading branch information
kerizane authored and blueyed committed Aug 28, 2020
1 parent 458abcb commit 96f1e06
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ Kale Kundert
Karl O. Pinc
Katarzyna Jachim
Katerina Koukiou
Keri Volans
Kevin Cox
Kevin J. Foley
Kodi B. Arfer
Expand Down
6 changes: 2 additions & 4 deletions src/_pytest/pytester/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
from _pytest.nodes import Item
from _pytest.outcomes import Failed
from _pytest.pathlib import _shorten_path
from _pytest.pathlib import make_numbered_dir
from _pytest.pathlib import Path
from _pytest.python import Function
from _pytest.python import Module
from _pytest.reports import TestReport
from _pytest.tmpdir import TempdirFactory


if TYPE_CHECKING:
from typing import Type
from typing_extensions import Literal # noqa: F401
Expand Down Expand Up @@ -1468,9 +1468,7 @@ def runpytest_subprocess(self, *args, stdin=CLOSE_STDIN, timeout=None) -> RunRes
Returns a :py:class:`RunResult`.
"""
__tracebackhide__ = True
p = py.path.local.make_numbered_dir(
prefix="runpytest-", keep=None, rootdir=self.tmpdir
)
p = make_numbered_dir(root=Path(self.tmpdir), prefix="runpytest-")
args = ("--basetemp=%s" % p,) + args
plugins = [x for x in self.plugins if isinstance(x, str)]
if plugins:
Expand Down
7 changes: 2 additions & 5 deletions testing/test_assertrewrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import zipfile
from functools import partial

import py

import _pytest._code
import pytest
from _pytest.assertion import util
Expand All @@ -22,6 +20,7 @@
from _pytest.assertion.rewrite import PYTEST_TAG
from _pytest.assertion.rewrite import rewrite_asserts
from _pytest.config import ExitCode
from _pytest.pathlib import make_numbered_dir
from _pytest.pathlib import Path
from _pytest.pytester import Testdir

Expand Down Expand Up @@ -823,9 +822,7 @@ def test_optimized():
"hello"
assert test_optimized.__doc__ is None"""
)
p = py.path.local.make_numbered_dir(
prefix="runpytest-", keep=None, rootdir=testdir.tmpdir
)
p = make_numbered_dir(root=Path(testdir.tmpdir), prefix="runpytest-")
tmp = "--basetemp=%s" % p
monkeypatch.setenv("PYTHONOPTIMIZE", "2")
monkeypatch.delenv("PYTHONDONTWRITEBYTECODE", raising=False)
Expand Down

0 comments on commit 96f1e06

Please sign in to comment.