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

Class ItemMightRaise

testing/test_runner.py:884–890  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

882 sys.last_traceback and friends."""
883 # Simulate item that might raise a specific exception, depending on `raise_error` class var
884 class ItemMightRaise:
885 nodeid = "item_that_raises"
886 raise_error = True
887
888 def runtest(self):
889 if self.raise_error:
890 raise IndexError("TEST")
891
892 try:
893 runner.pytest_runtest_call(ItemMightRaise()) # type: ignore[arg-type]

Callers 1

Calls

no outgoing calls

Tested by 1