Merge pull request #6744 from bluetech/item-runtest-stub
Add Item.runtest stub implementation
This commit is contained in:
commit
0c68e7a2c9
|
@ -239,7 +239,7 @@ class DoctestItem(pytest.Item):
|
||||||
globs[name] = value
|
globs[name] = value
|
||||||
self.dtest.globs.update(globs)
|
self.dtest.globs.update(globs)
|
||||||
|
|
||||||
def runtest(self):
|
def runtest(self) -> None:
|
||||||
_check_all_skipped(self.dtest)
|
_check_all_skipped(self.dtest)
|
||||||
self._disable_output_capturing_for_darwin()
|
self._disable_output_capturing_for_darwin()
|
||||||
failures = [] # type: List[doctest.DocTestFailure]
|
failures = [] # type: List[doctest.DocTestFailure]
|
||||||
|
|
|
@ -521,6 +521,9 @@ class Item(Node):
|
||||||
#: defined properties for this test.
|
#: defined properties for this test.
|
||||||
self.user_properties = [] # type: List[Tuple[str, Any]]
|
self.user_properties = [] # type: List[Tuple[str, Any]]
|
||||||
|
|
||||||
|
def runtest(self) -> None:
|
||||||
|
raise NotImplementedError("runtest must be implemented by Item subclass")
|
||||||
|
|
||||||
def add_report_section(self, when: str, key: str, content: str) -> None:
|
def add_report_section(self, when: str, key: str, content: str) -> None:
|
||||||
"""
|
"""
|
||||||
Adds a new report section, similar to what's done internally to add stdout and
|
Adds a new report section, similar to what's done internally to add stdout and
|
||||||
|
|
|
@ -1474,7 +1474,7 @@ class Function(PyobjMixin, nodes.Item):
|
||||||
warnings.warn(FUNCARGNAMES, stacklevel=2)
|
warnings.warn(FUNCARGNAMES, stacklevel=2)
|
||||||
return self.fixturenames
|
return self.fixturenames
|
||||||
|
|
||||||
def runtest(self):
|
def runtest(self) -> None:
|
||||||
""" execute the underlying test function. """
|
""" execute the underlying test function. """
|
||||||
self.ihook.pytest_pyfunc_call(pyfuncitem=self)
|
self.ihook.pytest_pyfunc_call(pyfuncitem=self)
|
||||||
|
|
||||||
|
@ -1519,7 +1519,7 @@ class FunctionDefinition(Function):
|
||||||
crappy metafunc hack
|
crappy metafunc hack
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def runtest(self):
|
def runtest(self) -> None:
|
||||||
raise RuntimeError("function definitions are not supposed to be used")
|
raise RuntimeError("function definitions are not supposed to be used")
|
||||||
|
|
||||||
setup = runtest
|
setup = runtest
|
||||||
|
|
Loading…
Reference in New Issue