fname
stringlengths
63
176
rel_fname
stringclasses
706 values
line
int64
-1
4.5k
name
stringlengths
1
81
kind
stringclasses
2 values
category
stringclasses
2 values
info
stringlengths
0
77.9k
⌀
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
683
decode
ref
function
assert stdout.decode("utf8").splitlines() == ["input", "2ndline"]
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
688
test_popen_default_stdin_stderr_and_stdin_None
def
function
def test_popen_default_stdin_stderr_and_stdin_None(pytester: Pytester) -> None: # stdout, stderr default to pipes, # stdin can be None to not close the pipe, avoiding # "ValueError: flush of closed file" with `communicate()`. # # Wraps the test to make it not hang when run with "-s". p1 = pytest...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
694
makepyfile
ref
function
p1 = pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
714
runpytest
ref
function
result = pytester.runpytest("-p", "pytester", str(p1))
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
718
test_spawn_uses_tmphome
def
function
def test_spawn_uses_tmphome(pytester: Pytester) -> None: tmphome = str(pytester.path) assert os.environ.get("HOME") == tmphome pytester._monkeypatch.setenv("CUSTOMENV", "42") p1 = pytester.makepyfile( """ import os def test(): assert os.environ["HOME"] == {tmphome!...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
722
setenv
ref
function
pytester._monkeypatch.setenv("CUSTOMENV", "42")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
724
makepyfile
ref
function
p1 = pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
735
spawn_pytest
ref
function
child = pytester.spawn_pytest(str(p1))
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
737
decode
ref
function
assert child.wait() == 0, out.decode("utf8")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
740
test_run_result_repr
def
function
def test_run_result_repr() -> None: outlines = ["some", "normal", "output"] errlines = ["some", "nasty", "errors", "happened"] # known exit code r = pytester_mod.RunResult(1, outlines, errlines, duration=0.5) assert ( repr(r) == "<RunResult ret=ExitCode.TESTS_FAILED len(stdout.lines)=3" ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
745
RunResult
ref
function
r = pytester_mod.RunResult(1, outlines, errlines, duration=0.5)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
752
RunResult
ref
function
r = pytester_mod.RunResult(99, outlines, errlines, duration=0.5)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
759
test_pytester_outcomes_with_multiple_errors
def
function
def test_pytester_outcomes_with_multiple_errors(pytester: Pytester) -> None: p1 = pytester.makepyfile( """ import pytest @pytest.fixture def bad_fixture(): raise Exception("bad") def test_error1(bad_fixture): pass def test_error2(bad_fixture...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
760
makepyfile
ref
function
p1 = pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
775
runpytest
ref
function
result = pytester.runpytest(str(p1))
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
776
assert_outcomes
ref
function
result.assert_outcomes(errors=2)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
778
parseoutcomes
ref
function
assert result.parseoutcomes() == {"errors": 2}
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
781
test_parse_summary_line_always_plural
def
function
def test_parse_summary_line_always_plural() -> None: """Parsing summaries always returns plural nouns (#6505)""" lines = [ "some output 1", "some output 2", "======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ====", "done.", ] assert pytester_mod.RunResult.parse_summ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
789
parse_summary_nouns
ref
function
assert pytester_mod.RunResult.parse_summary_nouns(lines) == {
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
802
parse_summary_nouns
ref
function
assert pytester_mod.RunResult.parse_summary_nouns(lines) == {
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
810
test_makefile_joins_absolute_path
def
function
def test_makefile_joins_absolute_path(pytester: Pytester) -> None: absfile = pytester.path / "absfile" p1 = pytester.makepyfile(**{str(absfile): ""}) assert str(p1) == str(pytester.path / "absfile.py")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
812
makepyfile
ref
function
p1 = pytester.makepyfile(**{str(absfile): ""})
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
816
test_testtmproot
def
function
def test_testtmproot(testdir) -> None: """Check test_tmproot is a py.path attribute for backward compatibility.""" assert testdir.test_tmproot.check(dir=1)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
818
check
ref
function
assert testdir.test_tmproot.check(dir=1)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
821
test_testdir_makefile_dot_prefixes_extension_silently
def
function
def test_testdir_makefile_dot_prefixes_extension_silently( testdir: Testdir,
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
825
makefile
ref
function
p1 = testdir.makefile("foo.bar", "")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
829
test_pytester_makefile_dot_prefixes_extension_with_warning
def
function
def test_pytester_makefile_dot_prefixes_extension_with_warning( pytester: Pytester,
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
832
raises
ref
function
with pytest.raises(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
836
makefile
ref
function
pytester.makefile("foo.bar", "")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
839
test_testdir_makefile_ext_none_raises_type_error
def
function
def test_testdir_makefile_ext_none_raises_type_error(testdir) -> None: """For backwards compat #8192""" with pytest.raises(TypeError): testdir.makefile(None, "")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
841
raises
ref
function
with pytest.raises(TypeError):
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
842
makefile
ref
function
testdir.makefile(None, "")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
845
test_testdir_makefile_ext_empty_string_makes_file
def
function
def test_testdir_makefile_ext_empty_string_makes_file(testdir) -> None: """For backwards compat #8192""" p1 = testdir.makefile("", "") assert "test_testdir_makefile" in str(p1)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_pytester.py
testing/test_pytester.py
847
makefile
ref
function
p1 = testdir.makefile("", "")
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
9
test_recwarn_stacklevel
def
function
def test_recwarn_stacklevel(recwarn: WarningsRecorder) -> None: warnings.warn("hello") warn = recwarn.pop() assert warn.filename == __file__
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
15
test_recwarn_functional
def
function
def test_recwarn_functional(pytester: Pytester) -> None: pytester.makepyfile( """ import warnings def test_method(recwarn): warnings.warn("hello") warn = recwarn.pop() assert isinstance(warn.message, UserWarning) """ ) reprec = pytester.inline_...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
16
makepyfile
ref
function
pytester.makepyfile(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
25
inline_run
ref
function
reprec = pytester.inline_run()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
26
assertoutcome
ref
function
reprec.assertoutcome(passed=1)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
30
test_recwarn_captures_deprecation_warning
def
function
def test_recwarn_captures_deprecation_warning(recwarn: WarningsRecorder) -> None: """ Check that recwarn can capture DeprecationWarning by default without custom filterwarnings (see #8666). """ warnings.warn(DeprecationWarning("some deprecation")) assert len(recwarn) == 1 assert recwarn.pop(...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
40
TestWarningsRecorderChecker
def
class
test_recording test_warn_stacklevel test_typechecking test_invalid_enter_exit
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
41
test_recording
def
function
def test_recording(self) -> None: rec = WarningsRecorder(_ispytest=_True) with rec: assert not rec.list warnings.warn_explicit("hello", UserWarning, "xyz", 13) assert len(rec.list) == 1 warnings.warn(DeprecationWarning("hello")) assert len(...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
42
WarningsRecorder
ref
function
rec = WarningsRecorder(_ispytest=True)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
55
raises
ref
function
pytest.raises(AssertionError, rec.pop)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
57
test_warn_stacklevel
def
function
def test_warn_stacklevel(self) -> None: """#4243""" rec = WarningsRecorder(_ispytest=_True) with rec: warnings.warn("test", DeprecationWarning, 2) def test_typechecking(self) -> None: from _pytest.recwarn import WarningsChecker with pytest.raises(TypeError):...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
59
WarningsRecorder
ref
function
rec = WarningsRecorder(_ispytest=True)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
63
test_typechecking
def
function
def test_typechecking(self) -> None: from _pytest.recwarn import WarningsChecker with pytest.raises(TypeError): WarningsChecker(5, _ispytest=_True) # type: ignore[arg-type] with pytest.raises(TypeError): WarningsChecker(("hi", RuntimeWarning), _ispytest=_True) # ty...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
66
raises
ref
function
with pytest.raises(TypeError):
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
67
WarningsChecker
ref
function
WarningsChecker(5, _ispytest=True) # type: ignore[arg-type]
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
68
raises
ref
function
with pytest.raises(TypeError):
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
69
WarningsChecker
ref
function
WarningsChecker(("hi", RuntimeWarning), _ispytest=True) # type: ignore[arg-type]
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
70
raises
ref
function
with pytest.raises(TypeError):
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
71
WarningsChecker
ref
function
WarningsChecker([DeprecationWarning, RuntimeWarning], _ispytest=True) # type: ignore[arg-type]
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
73
test_invalid_enter_exit
def
function
def test_invalid_enter_exit(self) -> None: # wrap this test in WarningsRecorder to ensure warning state gets reset with WarningsRecorder(_ispytest=_True): with pytest.raises(RuntimeError): rec = WarningsRecorder(_ispytest=_True) rec.__exit__(None, None, No...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
75
WarningsRecorder
ref
function
with WarningsRecorder(_ispytest=True):
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
76
raises
ref
function
with pytest.raises(RuntimeError):
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
77
WarningsRecorder
ref
function
rec = WarningsRecorder(_ispytest=True)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
78
__exit__
ref
function
rec.__exit__(None, None, None) # can't exit before entering
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
80
raises
ref
function
with pytest.raises(RuntimeError):
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
81
WarningsRecorder
ref
function
rec = WarningsRecorder(_ispytest=True)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
87
TestDeprecatedCall
def
class
dep dep_explicit test_deprecated_call_raises test_deprecated_call test_deprecated_call_ret test_deprecated_call_preserves test_deprecated_explicit_call_raises test_deprecated_explicit_call test_deprecated_call_no_warning test_deprecated_call_modes test_deprecated_call_exception_is_raised test_deprecated_call_specificit...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
90
dep
def
function
def dep(self, i: int, j: Optional[int] = None) -> int: if i == 0: warnings.warn("is deprecated", DeprecationWarning, stacklevel=1) return 42 def dep_explicit(self, i: int) -> None: if i == 0: warnings.warn_explicit( "dep_explicit", category=Deprec...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
95
dep_explicit
def
function
def dep_explicit(self, i: int) -> None: if i == 0: warnings.warn_explicit( "dep_explicit", category=DeprecationWarning, filename="hello", lineno=3 ) def test_deprecated_call_raises(self) -> None: with pytest.raises(pytest.fail.Exception, match="No warning...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
101
test_deprecated_call_raises
def
function
def test_deprecated_call_raises(self) -> None: with pytest.raises(pytest.fail.Exception, match="No warnings of type"): pytest.deprecated_call(self.dep, 3, 5) def test_deprecated_call(self) -> None: pytest.deprecated_call(self.dep, 0, 5) def test_deprecated_call_ret(self) -> Non...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
102
raises
ref
function
with pytest.raises(pytest.fail.Exception, match="No warnings of type"):
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
103
deprecated_call
ref
function
pytest.deprecated_call(self.dep, 3, 5)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
105
test_deprecated_call
def
function
def test_deprecated_call(self) -> None: pytest.deprecated_call(self.dep, 0, 5) def test_deprecated_call_ret(self) -> None: ret = pytest.deprecated_call(self.dep, 0) assert ret == 42 def test_deprecated_call_preserves(self) -> None: # Type ignored because `onceregistry` and ...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
106
deprecated_call
ref
function
pytest.deprecated_call(self.dep, 0, 5)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
108
test_deprecated_call_ret
def
function
def test_deprecated_call_ret(self) -> None: ret = pytest.deprecated_call(self.dep, 0) assert ret == 42 def test_deprecated_call_preserves(self) -> None: # Type ignored because `onceregistry` and `filters` are not # documented API. onceregistry = warnings.onceregistry.cop...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
109
deprecated_call
ref
function
ret = pytest.deprecated_call(self.dep, 0)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
112
test_deprecated_call_preserves
def
function
def test_deprecated_call_preserves(self) -> None: # Type ignored because `onceregistry` and `filters` are not # documented API. onceregistry = warnings.onceregistry.copy() # type: ignore filters = warnings.filters[:] # type: ignore warn = warnings.warn warn_explicit...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
119
test_deprecated_call_raises
ref
function
self.test_deprecated_call_raises()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
120
test_deprecated_call
ref
function
self.test_deprecated_call()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
126
test_deprecated_explicit_call_raises
def
function
def test_deprecated_explicit_call_raises(self) -> None: with pytest.raises(pytest.fail.Exception): pytest.deprecated_call(self.dep_explicit, 3) def test_deprecated_explicit_call(self) -> None: pytest.deprecated_call(self.dep_explicit, 0) pytest.deprecated_call(self.dep_expli...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
127
raises
ref
function
with pytest.raises(pytest.fail.Exception):
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
128
deprecated_call
ref
function
pytest.deprecated_call(self.dep_explicit, 3)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
130
test_deprecated_explicit_call
def
function
def test_deprecated_explicit_call(self) -> None: pytest.deprecated_call(self.dep_explicit, 0) pytest.deprecated_call(self.dep_explicit, 0) @pytest.mark.parametrize("mode", ["context_manager", "call"]) def test_deprecated_call_no_warning(self, mode) -> None: """Ensure deprecated_call...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
131
deprecated_call
ref
function
pytest.deprecated_call(self.dep_explicit, 0)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
132
deprecated_call
ref
function
pytest.deprecated_call(self.dep_explicit, 0)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
134
parametrize
ref
function
@pytest.mark.parametrize("mode", ["context_manager", "call"])
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
135
test_deprecated_call_no_warning
def
function
def test_deprecated_call_no_warning(self, mode) -> None: """Ensure deprecated_call() raises the expected failure when its block/function does not raise a deprecation warning. """ def f(): pass msg = "No warnings of type (.*DeprecationWarning.*, .*PendingDeprecat...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
140
f
def
function
def f(): pass msg = "No warnings of type (.*DeprecationWarning.*, .*PendingDeprecationWarning.*)" with pytest.raises(pytest.fail.Exception, match=msg): if mode == "call": pytest.deprecated_call(f) else: with pytest.deprecated_c...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
144
raises
ref
function
with pytest.raises(pytest.fail.Exception, match=msg):
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
146
deprecated_call
ref
function
pytest.deprecated_call(f)
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
148
deprecated_call
ref
function
with pytest.deprecated_call():
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
149
f
ref
function
f()
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
151
parametrize
ref
function
@pytest.mark.parametrize(
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
154
parametrize
ref
function
@pytest.mark.parametrize("mode", ["context_manager", "call"])
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
155
parametrize
ref
function
@pytest.mark.parametrize("call_f_first", [True, False])
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
157
test_deprecated_call_modes
def
function
def test_deprecated_call_modes(self, warning_type, mode, call_f_first) -> None: """Ensure deprecated_call() captures a deprecation warning as expected inside its block/function. """ def f(): warnings.warn(warning_type("hi")) return 10 # ensure deprec...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
162
f
def
function
def f(): pass msg = "No warnings of type (.*DeprecationWarning.*, .*PendingDeprecationWarning.*)" with pytest.raises(pytest.fail.Exception, match=msg): if mode == "call": pytest.deprecated_call(f) else: with pytest.deprecated_c...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
163
warning_type
ref
function
warnings.warn(warning_type("hi"))
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
168
f
ref
function
assert f() == 10
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
170
deprecated_call
ref
function
assert pytest.deprecated_call(f) == 10
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
172
deprecated_call
ref
function
with pytest.deprecated_call():
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
173
f
ref
function
assert f() == 10
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
175
parametrize
ref
function
@pytest.mark.parametrize("mode", ["context_manager", "call"])
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
176
test_deprecated_call_exception_is_raised
def
function
def test_deprecated_call_exception_is_raised(self, mode) -> None: """If the block of the code being tested by deprecated_call() raises an exception, it must raise the exception undisturbed. """ def f(): raise ValueError("some exception") with pytest.raises(Value...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
181
f
def
function
def f(): pass msg = "No warnings of type (.*DeprecationWarning.*, .*PendingDeprecationWarning.*)" with pytest.raises(pytest.fail.Exception, match=msg): if mode == "call": pytest.deprecated_call(f) else: with pytest.deprecated_c...
playground/385a4687-3c82-4369-b8de-c1d8c2e759f9/pytest/testing/test_recwarn.py
testing/test_recwarn.py
184
raises
ref
function
with pytest.raises(ValueError, match="some exception"):