You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by eleanorjboyd July 11, 2023
Quick question on pytest_keyboard_interrupt. When I use a pytest plugin and the tests I am running my plugin on have a ModuleNotFoundError my plugin calls both the pytest_exception_interact hook and then the pytest_keyboard_interrupt hook. Why is pytest_keyboard_interrupt called for a ModuleNotFoundError? Is there any way to make it so it hits only one of the exception hooks? I am trying to keep track of the number of errors hit during discovery and a single error triggering two error hooks is making that more complicated. Also open to suggestions regarding another work-around. Thanks!
The text was updated successfully, but these errors were encountered:
Hi @The-Compiler had quick look and yeah it looks like Session.Interrupted still remains a subclass of KeyboardInterrupt sadly, changing that looks sizable - is it sufficient do you think to add some specifics to wrap_session to only invoke the keyboard_interrupt hook if typename/type matches KeyboardInterrupt exception explicitly?
Discussed in #11199
Originally posted by eleanorjboyd July 11, 2023
Quick question on pytest_keyboard_interrupt. When I use a pytest plugin and the tests I am running my plugin on have a ModuleNotFoundError my plugin calls both the pytest_exception_interact hook and then the pytest_keyboard_interrupt hook. Why is pytest_keyboard_interrupt called for a ModuleNotFoundError? Is there any way to make it so it hits only one of the exception hooks? I am trying to keep track of the number of errors hit during discovery and a single error triggering two error hooks is making that more complicated. Also open to suggestions regarding another work-around. Thanks!
The text was updated successfully, but these errors were encountered: