def test_dir() -> None:
    """dir() on git.compat includes all public attributes, even if deprecated.

    As dir() usually does, it also has nonpublic attributes, which should also not be
    removed by a custom __dir__ function, but those are less important to test.
    """
    expected_subset = {
        "is_win",
        "is_posix",
        "is_darwin",
        "defenc",
        "safe_decode",
        "safe_encode",
        "win_encode",
    }
    actual = set(dir(git.compat))
    assert expected_subset <= actual
dir() on git.compat includes all public attributes, even if deprecated.

    As dir() usually does, it also has nonpublic attributes, which should also not be
    removed by a custom __dir__ function, but those are less important to test.
    
test/deprecation/test_compat.py