(pytester: Pytester)
| 81 | |
| 82 | |
| 83 | def 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 | |
| 107 | def test_nose_setup_func_failure_2(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected