We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c85b21e commit 16685dcCopy full SHA for 16685dc
src/_pytest/tmpdir.py
@@ -1,6 +1,7 @@
1
"""Support for providing temporary directories to test functions."""
2
import os
3
import re
4
+import sys
5
import tempfile
6
from pathlib import Path
7
from typing import Optional
@@ -130,9 +131,9 @@ def getbasetemp(self) -> Path:
130
131
# Also, to keep things private, fixup any world-readable temp
132
# rootdir's permissions. Historically 0o755 was used, so we can't
133
# just error out on this, at least for a while.
- if hasattr(os, "getuid"):
134
- rootdir_stat = rootdir.stat()
+ if sys.platform != "win32":
135
uid = os.getuid()
136
+ rootdir_stat = rootdir.stat()
137
# getuid shouldn't fail, but cpython defines such a case.
138
# Let's hope for the best.
139
if uid != -1:
0 commit comments