Skip to content

tests: fix test_cwd_snapshot #6536

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

Merged
merged 1 commit into from
Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/_pytest/pytester.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@ class Testdir:

"""

__test__ = False

CLOSE_STDIN = object

class TimeoutExpired(Exception):
Expand Down
4 changes: 3 additions & 1 deletion testing/test_pytester.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from _pytest.pytester import LineMatcher
from _pytest.pytester import SysModulesSnapshot
from _pytest.pytester import SysPathsSnapshot
from _pytest.pytester import Testdir


def test_make_hook_recorder(testdir) -> None:
Expand Down Expand Up @@ -273,7 +274,8 @@ def test_assert_outcomes_after_pytest_error(testdir) -> None:
result.assert_outcomes(passed=0)


def test_cwd_snapshot(tmpdir) -> None:
def test_cwd_snapshot(testdir: Testdir) -> None:
tmpdir = testdir.tmpdir
foo = tmpdir.ensure("foo", dir=1)
bar = tmpdir.ensure("bar", dir=1)
foo.chdir()
Expand Down