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

Method test_class_with_new_warning

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

Source from the content-addressed store, hash-verified

160 )
161
162 def test_class_with_new_warning(self, pytester: Pytester) -> None:
163 pytester.makepyfile(
164 """
165 class TestClass1(object):
166 def __new__(self):
167 pass
168 """
169 )
170 result = pytester.runpytest()
171 result.stdout.fnmatch_lines(
172 [
173 "*cannot collect test class 'TestClass1' because it has "
174 "a __new__ constructor (from: test_class_with_new_warning.py)"
175 ]
176 )
177
178 def test_class_subclassobject(self, pytester: Pytester) -> None:
179 pytester.getmodulecol(

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected