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

Method test_class_with_init_warning

testing/python/collect.py:146–160  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

144
145class TestClass:
146 def test_class_with_init_warning(self, pytester: Pytester) -> None:
147 pytester.makepyfile(
148 """
149 class TestClass1(object):
150 def __init__(self):
151 pass
152 """
153 )
154 result = pytester.runpytest()
155 result.stdout.fnmatch_lines(
156 [
157 "*cannot collect test class 'TestClass1' because it has "
158 "a __init__ constructor (from: test_class_with_init_warning.py)"
159 ]
160 )
161
162 def test_class_with_new_warning(self, pytester: Pytester) -> None:
163 pytester.makepyfile(

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected