1a96f16401
Makes `AbstractContextManager` the shared base class between "raises" and other context managers. The motivation is for type checkers to narrow `pytest.raises(...) if x else nullcontext()` to a `ContextManager` rather than `object`.
3 lines
193 B
ReStructuredText
3 lines
193 B
ReStructuredText
Fix :py:func:`pytest.raises` to return a 'ContextManager' so that type-checkers could narrow
|
|
:code:`pytest.raises(...) if ... else nullcontext()` down to 'ContextManager' rather than 'object'.
|