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/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
903
ItemMightRaise
ref
function
runner.pytest_runtest_call(ItemMightRaise()) # type: ignore[arg-type]
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
909
test_current_test_env_var
def
function
def test_current_test_env_var(pytester: Pytester, monkeypatch: MonkeyPatch) -> None: pytest_current_test_vars: List[Tuple[str, str]] = [] monkeypatch.setattr( sys, "pytest_current_test_vars", pytest_current_test_vars, raising=_False ) pytester.makepyfile( """ import pytest ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
914
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
930
runpytest_inprocess
ref
function
result = pytester.runpytest_inprocess()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
941
TestReportContents
def
class
getrunner test_longreprtext_pass test_longreprtext_skip test_longreprtext_collect_skip test_longreprtext_failure test_captured_text test_no_captured_text test_longrepr_type
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
944
getrunner
def
function
def getrunner(self): def f(item): return runner.runtestprotocol(item, log=_False) return f def test_keyboardinterrupt_propagates(self, pytester: Pytester) -> None: try: pytester.runitem( """ def test_func(): ra...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
945
runtestprotocol
ref
function
return lambda item: runner.runtestprotocol(item, log=False)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
947
test_longreprtext_pass
def
function
def test_longreprtext_pass(self, pytester: Pytester) -> None: reports = pytester.runitem( """ def test_func(): pass """ ) rep = reports[1] assert rep.longreprtext == "" def test_longreprtext_skip(self, pytester: Pytester) -> None: ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
948
runitem
ref
function
reports = pytester.runitem(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
957
test_longreprtext_skip
def
function
def test_longreprtext_skip(self, pytester: Pytester) -> None: """TestReport.longreprtext can handle non-str ``longrepr`` attributes (#7559)""" reports = pytester.runitem( """ import pytest def test_func(): pytest.skip() """ ) ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
959
runitem
ref
function
reports = pytester.runitem(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
970
test_longreprtext_collect_skip
def
function
def test_longreprtext_collect_skip(self, pytester: Pytester) -> None: """CollectReport.longreprtext can handle non-str ``longrepr`` attributes (#7559)""" pytester.makepyfile( """ import pytest pytest.skip(allow_module_level=_True) """ ) ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
972
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
978
inline_run
ref
function
rec = pytester.inline_run()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
979
getcalls
ref
function
calls = rec.getcalls("pytest_collectreport")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
984
test_longreprtext_failure
def
function
def test_longreprtext_failure(self, pytester: Pytester) -> None: reports = pytester.runitem( """ def test_func(): x = 1 assert x == 4 """ ) rep = reports[1] assert "assert 1 == 4" in rep.longreprtext def test_captur...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
985
runitem
ref
function
reports = pytester.runitem(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
995
test_captured_text
def
function
def test_captured_text(self, pytester: Pytester) -> None: reports = pytester.runitem( """ import pytest import sys @pytest.fixture def fix(): sys.stdout.write('setup: stdout\\n') sys.stderr.write('setup: stderr\\n')...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
996
runitem
ref
function
reports = pytester.runitem(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
1,025
test_no_captured_text
def
function
def test_no_captured_text(self, pytester: Pytester) -> None: reports = pytester.runitem( """ def test_func(): pass """ ) rep = reports[1] assert rep.capstdout == "" assert rep.capstderr == "" def test_longrepr_type(self, py...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
1,026
runitem
ref
function
reports = pytester.runitem(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
1,036
test_longrepr_type
def
function
def test_longrepr_type(self, pytester: Pytester) -> None: reports = pytester.runitem( """ import pytest def test_func(): pytest.fail(pytrace=_False) """ ) rep = reports[1] assert isinstance(rep.longrepr, ExceptionChainRepr) ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
1,037
runitem
ref
function
reports = pytester.runitem(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
1,048
test_outcome_exception_bad_msg
def
function
def test_outcome_exception_bad_msg() -> None: """Check that OutcomeExceptions validate their input to prevent confusing errors (#5578)""" def func() -> None: raise NotImplementedError() expected = ( "OutcomeException expected string as 'msg' parameter, got 'function' instead.\n" "P...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
1,051
func
def
function
def func() -> None: raise NotImplementedError() expected = ( "OutcomeException expected string as 'msg' parameter, got 'function' instead.\n" "Perhaps you meant to use a mark?" ) with pytest.raises(TypeError) as excinfo: OutcomeException(func) # type: ignore assert ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
1,058
raises
ref
function
with pytest.raises(TypeError) as excinfo:
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner.py
testing/test_runner.py
1,059
OutcomeException
ref
function
OutcomeException(func) # type: ignore
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
7
test_module_and_function_setup
def
function
def test_module_and_function_setup(pytester: Pytester) -> None: reprec = pytester.inline_runsource( """ modlevel = [] def setup_module(module): assert not modlevel module.modlevel.append(42) def teardown_module(module): modlevel.pop() def...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
8
inline_runsource
ref
function
reprec = pytester.inline_runsource(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
34
matchreport
ref
function
rep = reprec.matchreport("test_modlevel")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
36
matchreport
ref
function
rep = reprec.matchreport("test_module")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
40
test_module_setup_failure_no_teardown
def
function
def test_module_setup_failure_no_teardown(pytester: Pytester) -> None: reprec = pytester.inline_runsource( """ values = [] def setup_module(module): values.append(1) 0/0 def test_nothing(): pass def teardown_module(module): va...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
41
inline_runsource
ref
function
reprec = pytester.inline_runsource(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
55
assertoutcome
ref
function
reprec.assertoutcome(failed=1)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
56
getcalls
ref
function
calls = reprec.getcalls("pytest_runtest_setup")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
60
test_setup_function_failure_no_teardown
def
function
def test_setup_function_failure_no_teardown(pytester: Pytester) -> None: reprec = pytester.inline_runsource( """ modlevel = [] def setup_function(function): modlevel.append(1) 0/0 def teardown_function(module): modlevel.append(2) def test...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
61
inline_runsource
ref
function
reprec = pytester.inline_runsource(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
75
getcalls
ref
function
calls = reprec.getcalls("pytest_runtest_setup")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
79
test_class_setup
def
class
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
80
inline_runsource
ref
function
reprec = pytester.inline_runsource(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
102
assertoutcome
ref
function
reprec.assertoutcome(passed=1 + 2 + 1)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
105
test_class_setup_failure_no_teardown
def
class
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
106
inline_runsource
ref
function
reprec = pytester.inline_runsource(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
123
assertoutcome
ref
function
reprec.assertoutcome(failed=1, passed=1)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
126
test_method_setup
def
function
def test_method_setup(pytester: Pytester) -> None: reprec = pytester.inline_runsource( """ class TestSetupMethod(object): def setup_method(self, meth): self.methsetup = meth def teardown_method(self, meth): del self.methsetup def t...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
127
inline_runsource
ref
function
reprec = pytester.inline_runsource(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
142
assertoutcome
ref
function
reprec.assertoutcome(passed=2)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
145
test_method_setup_failure_no_teardown
def
function
def test_method_setup_failure_no_teardown(pytester: Pytester) -> None: reprec = pytester.inline_runsource( """ class TestMethodSetup(object): clslevel = [] def setup_method(self, method): self.clslevel.append(1) 0/0 def teardown_me...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
146
inline_runsource
ref
function
reprec = pytester.inline_runsource(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
164
assertoutcome
ref
function
reprec.assertoutcome(failed=1, passed=1)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
167
test_method_setup_uses_fresh_instances
def
function
def test_method_setup_uses_fresh_instances(pytester: Pytester) -> None: reprec = pytester.inline_runsource( """ class TestSelfState1(object): memory = [] def test_hello(self): self.memory.append(self) def test_afterhello(self): ass...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
168
inline_runsource
ref
function
reprec = pytester.inline_runsource(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
179
assertoutcome
ref
function
reprec.assertoutcome(passed=2, failed=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
182
test_setup_that_skips_calledagain
def
function
def test_setup_that_skips_calledagain(pytester: Pytester) -> None: p = pytester.makepyfile( """ import pytest def setup_module(mod): pytest.skip("x") def test_function1(): pass def test_function2(): pass """ ) reprec = pytester....
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
183
makepyfile
ref
function
p = pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
194
inline_run
ref
function
reprec = pytester.inline_run(p)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
195
assertoutcome
ref
function
reprec.assertoutcome(skipped=2)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
198
test_setup_fails_again_on_all_tests
def
function
def test_setup_fails_again_on_all_tests(pytester: Pytester) -> None: p = pytester.makepyfile( """ import pytest def setup_module(mod): raise ValueError(42) def test_function1(): pass def test_function2(): pass """ ) reprec = pyt...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
199
makepyfile
ref
function
p = pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
210
inline_run
ref
function
reprec = pytester.inline_run(p)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
211
assertoutcome
ref
function
reprec.assertoutcome(failed=2)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
214
test_setup_funcarg_setup_when_outer_scope_fails
def
function
def test_setup_funcarg_setup_when_outer_scope_fails(pytester: Pytester) -> None: p = pytester.makepyfile( """ import pytest def setup_module(mod): raise ValueError(42) @pytest.fixture def hello(request): raise ValueError("xyz43") def test_funct...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
215
makepyfile
ref
function
p = pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
229
runpytest
ref
function
result = pytester.runpytest(p)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
230
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
239
no_fnmatch_line
ref
function
result.stdout.no_fnmatch_line("*xyz43*")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
242
parametrize
ref
function
@pytest.mark.parametrize("arg", ["", "arg"])
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
243
test_setup_teardown_function_level_with_optional_argument
def
function
def test_setup_teardown_function_level_with_optional_argument( pytester: Pytester, monkeypatch, arg: str,
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
255
makepyfile
ref
function
p = pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
281
inline_run
ref
function
result = pytester.inline_run(p)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_runner_xunit.py
testing/test_runner_xunit.py
282
assertoutcome
ref
function
result.assertoutcome(passed=4)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
6
test_ordering
def
function
def test_ordering() -> None: assert Scope.Session > Scope.Package assert Scope.Package > Scope.Module assert Scope.Module > Scope.Class assert Scope.Class > Scope.Function
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
13
test_next_lower
def
function
def test_next_lower() -> None: assert Scope.Session.next_lower() is Scope.Package assert Scope.Package.next_lower() is Scope.Module assert Scope.Module.next_lower() is Scope.Class assert Scope.Class.next_lower() is Scope.Function with pytest.raises(ValueError, match="Function is the lower-most scop...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
14
next_lower
ref
function
assert Scope.Session.next_lower() is Scope.Package
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
15
next_lower
ref
function
assert Scope.Package.next_lower() is Scope.Module
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
16
next_lower
ref
function
assert Scope.Module.next_lower() is Scope.Class
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
17
next_lower
ref
function
assert Scope.Class.next_lower() is Scope.Function
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
19
raises
ref
function
with pytest.raises(ValueError, match="Function is the lower-most scope"):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
20
next_lower
ref
function
Scope.Function.next_lower()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
23
test_next_higher
def
function
def test_next_higher() -> None: assert Scope.Function.next_higher() is Scope.Class assert Scope.Class.next_higher() is Scope.Module assert Scope.Module.next_higher() is Scope.Package assert Scope.Package.next_higher() is Scope.Session with pytest.raises(ValueError, match="Session is the upper-most ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
24
next_higher
ref
function
assert Scope.Function.next_higher() is Scope.Class
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
25
next_higher
ref
function
assert Scope.Class.next_higher() is Scope.Module
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
26
next_higher
ref
function
assert Scope.Module.next_higher() is Scope.Package
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
27
next_higher
ref
function
assert Scope.Package.next_higher() is Scope.Session
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
29
raises
ref
function
with pytest.raises(ValueError, match="Session is the upper-most scope"):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
30
next_higher
ref
function
Scope.Session.next_higher()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
33
test_from_user
def
function
def test_from_user() -> None: assert Scope.from_user("module", "for parametrize", "some::id") is Scope.Module expected_msg = "for parametrize from some::id got an unexpected scope value 'foo'" with pytest.raises(pytest.fail.Exception, match=re.escape(expected_msg)): Scope.from_user("foo", "for para...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
34
from_user
ref
function
assert Scope.from_user("module", "for parametrize", "some::id") is Scope.Module
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
37
raises
ref
function
with pytest.raises(pytest.fail.Exception, match=re.escape(expected_msg)):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_scope.py
testing/test_scope.py
38
from_user
ref
function
Scope.from_user("foo", "for parametrize", "some::id") # type:ignore[arg-type]
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_session.py
testing/test_session.py
6
SessionTests
def
class
test_basic_testitem_events test_nested_import_error test_raises_output test_syntax_error_module test_exit_first_problem test_maxfail test_broken_repr test_broken_repr_with_showlocals_verbose test_skip_file_by_conftest
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_session.py
testing/test_session.py
7
test_basic_testitem_events
def
function
def test_basic_testitem_events(self, pytester: Pytester) -> None: tfile = pytester.makepyfile( """ def test_one(): pass def test_one_one(): assert 0 def test_other(): raise ValueError(23) class TestCl...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_session.py
testing/test_session.py
8
makepyfile
ref
function
tfile = pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_session.py
testing/test_session.py
21
inline_run
ref
function
reprec = pytester.inline_run(tfile)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_session.py
testing/test_session.py
22
listoutcomes
ref
function
passed, skipped, failed = reprec.listoutcomes()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_session.py
testing/test_session.py
27
end
def
function
def end(x): return x.nodeid.split("::")[-1] assert end(failed[0]) == "test_one_one" assert end(failed[1]) == "test_other" itemstarted = reprec.getcalls("pytest_itemcollected") assert len(itemstarted) == 4 # XXX check for failing funcarg setup # colrep...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_session.py
testing/test_session.py
30
end
ref
function
assert end(failed[0]) == "test_one_one"
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_session.py
testing/test_session.py
31
end
ref
function
assert end(failed[1]) == "test_other"
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_session.py
testing/test_session.py
32
getcalls
ref
function
itemstarted = reprec.getcalls("pytest_itemcollected")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_session.py
testing/test_session.py
39
test_nested_import_error
def
function
def test_nested_import_error(self, pytester: Pytester) -> None: tfile = pytester.makepyfile( """ import import_fails def test_this(): assert import_fails.a == 1 """, import_fails=""" import does_not_work a = 1 ...