aboutsummaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/unix_compat.py
blob: a5d9ee45ccc639794d29ba0a5fd24f781ee5ecf5 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import sys

try:
    import grp
    import pwd
except ImportError:
    grp = pwd = None

import pytest

UNIX_ID_SUPPORT = grp and pwd
UID_0_SUPPORT = UNIX_ID_SUPPORT and sys.platform != "cygwin"

require_unix_id = pytest.mark.skipif(
    not UNIX_ID_SUPPORT, reason="Requires grp and pwd support"
)
require_uid_0 = pytest.mark.skipif(not UID_0_SUPPORT, reason="Requires UID 0 support")