(pytester: Pytester)
| 283 | |
| 284 | |
| 285 | def test_apiwrapper_problem_issue260(pytester: Pytester) -> None: |
| 286 | # this would end up trying a call an optional teardown on the class |
| 287 | # for plain unittests we don't want nose behaviour |
| 288 | pytester.makepyfile( |
| 289 | """ |
| 290 | import unittest |
| 291 | class TestCase(unittest.TestCase): |
| 292 | def setup(self): |
| 293 | #should not be called in unittest testcases |
| 294 | assert 0, 'setup' |
| 295 | def teardown(self): |
| 296 | #should not be called in unittest testcases |
| 297 | assert 0, 'teardown' |
| 298 | def setUp(self): |
| 299 | print('setup') |
| 300 | def tearDown(self): |
| 301 | print('teardown') |
| 302 | def test_fun(self): |
| 303 | pass |
| 304 | """ |
| 305 | ) |
| 306 | result = pytester.runpytest() |
| 307 | result.assert_outcomes(passed=1) |
| 308 | |
| 309 | |
| 310 | def test_setup_teardown_linking_issue265(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected