@pytest.mark.parametrize('attr', ['stderr', '__stderr__'])
def test_init_faulthandler_stderr_none(monkeypatch, attr):
 monkeypatch.setattr(sys, attr, None)
 earlyinit.init_faulthandler()

@ pytest . mark . parametrize ( 'attr' , [ 'stderr' , '__stderr__' ] ) def test_init_faulthandler_stderr_none ( monkeypatch , attr ) : monkeypatch . setattr ( sys , attr , None ) earlyinit . init_faulthandler ( )
make sure init_faulthandler works when sys .