diff --git a/changelog/10765.bugfix.rst b/changelog/10765.bugfix.rst new file mode 100644 index 000000000..754abd72c --- /dev/null +++ b/changelog/10765.bugfix.rst @@ -0,0 +1 @@ +Fix temp_path fixture always raising OSError on emscripten due to missing getuid diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index ec44623dc..64f1de072 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -176,7 +176,7 @@ class TempPathFactory: # Also, to keep things private, fixup any world-readable temp # rootdir's permissions. Historically 0o755 was used, so we can't # just error out on this, at least for a while. - if sys.platform != "win32": + if sys.platform != "win32" and sys.platform != "emscripten": uid = os.getuid() rootdir_stat = rootdir.stat() # getuid shouldn't fail, but cpython defines such a case.