MCPcopy
hub / github.com/pytest-dev/pytest / newinstance

Method newinstance

src/_pytest/unittest.py:84–90  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

82 nofuncargs = True
83
84 def newinstance(self):
85 # TestCase __init__ takes the method (test) name. The TestCase
86 # constructor treats the name "runTest" as a special no-op, so it can be
87 # used when a dummy instance is needed. While unittest.TestCase has a
88 # default, some subclasses omit the default (#9610), so always supply
89 # it.
90 return self.obj("runTest")
91
92 def collect(self) -> Iterable[Item | Collector]:
93 from unittest import TestLoader

Callers 1

collectMethod · 0.95

Calls 1

objMethod · 0.80

Tested by

no test coverage detected