def test_disabled(pytester: Pytester) -> None:
    """Test option to disable fault handler in the command line."""
    pytester.makepyfile(
        """
    import faulthandler
    def test_disabled():
        assert not faulthandler.is_enabled()
    """
    )
    result = pytester.runpytest_subprocess("-p", "no:faulthandler")
    result.stdout.fnmatch_lines(["*1 passed*"])
    assert result.ret == 0
Test option to disable fault handler in the command line.
testing/test_faulthandler.py