Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OSError in tmpdir on emscripten due to missing getuid() #10766

Merged
merged 4 commits into from
Mar 5, 2023

Conversation

rdb
Copy link
Contributor

@rdb rdb commented Feb 24, 2023

Emscripten defines getuid() as a stub that always returns 0. This change is necessary for our unit testing suite to pass under node.js.

Have no need to be added to AUTHORS for such a trivial change.

Closes #10765

@nicoddemus
Copy link
Member

Thanks @rdb!

FYI decided to move the uid-handling logic to a separate function in _pytest.compat.

Would appreciate a second set of eyes reviewing the change. 👍

@@ -46,7 +45,7 @@
# fmt: on


def legacy_path(path: Union[str, "os.PathLike[str]"]) -> LEGACY_PATH:
def legacy_path(path: str | os.PathLike[str]) -> LEGACY_PATH:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: type annotation changes were introduced by pyupgrade because I added the from __future__ import annotations import.

@nicoddemus nicoddemus added the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Feb 28, 2023
@rdb
Copy link
Contributor Author

rdb commented Feb 28, 2023

Thanks. Seems fine, I built with your changes and our test suite is still passing.

Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, let's merge 👍

@Zac-HD Zac-HD merged commit b3b44ea into pytest-dev:main Mar 5, 2023
@rdb rdb deleted the fix-10765 branch March 7, 2023 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tmp_path always raises exception on emscripten
3 participants