-
I have a scenario where I need the collected items, as I want to dynamically apply some behaviour based on markers, however if something goes wrong inside Pseudo Hook: @pytest.hookimpl
def pytest_collection_modifyitems(self, session: Session, items: List[Item]) -> None:
try:
do_something()
except SomeException as exc:
session.shouldstop = f"something bad happened: {str(exc)}"
pytest.exit(str(exc)) Is this sufficient? I find when i just pytest.exit() here, im getting a 1 exit code (without a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
actually ignore this, |
Beta Was this translation helpful? Give feedback.
actually ignore this,
pytest.exit()
in the hook returns a 2 not a 1 :)