Merge pull request #8399 from atzannes/master

closes #8394

Generated fixture names for unittest/xunit/nose should start with underscore
This commit is contained in:
Alexandros Tzannes
2021-03-04 15:45:57 -05:00
committed by GitHub
parent 6e7dc8bac8
commit 19a2f7425d
5 changed files with 74 additions and 5 deletions
+24
View File
@@ -302,6 +302,30 @@ def test_setup_setUpClass(pytester: Pytester) -> None:
reprec.assertoutcome(passed=3)
def test_fixtures_setup_setUpClass_issue8394(pytester: Pytester) -> None:
pytester.makepyfile(
"""
import unittest
class MyTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
pass
def test_func1(self):
pass
@classmethod
def tearDownClass(cls):
pass
"""
)
result = pytester.runpytest("--fixtures")
assert result.ret == 0
result.stdout.no_fnmatch_line("*no docstring available*")
result = pytester.runpytest("--fixtures", "-v")
assert result.ret == 0
result.stdout.fnmatch_lines(["*no docstring available*"])
def test_setup_class(pytester: Pytester) -> None:
testpath = pytester.makepyfile(
"""