MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_nose_setup_func_failure

Function test_nose_setup_func_failure

testing/test_nose.py:83–104  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

81
82
83def test_nose_setup_func_failure(pytester: Pytester) -> None:
84 p = pytester.makepyfile(
85 """
86 from nose.tools import with_setup
87
88 values = []
89 my_setup = lambda x: 1
90 my_teardown = lambda x: 2
91
92 @with_setup(my_setup, my_teardown)
93 def test_hello():
94 print(values)
95 assert values == [1]
96
97 def test_world():
98 print(values)
99 assert values == [1,2]
100
101 """
102 )
103 result = pytester.runpytest(p, "-p", "nose")
104 result.stdout.fnmatch_lines(["*TypeError: <lambda>()*"])
105
106
107def test_nose_setup_func_failure_2(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected