-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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: closes #11343's [attr-defined] type errors #11345
fix: closes #11343's [attr-defined] type errors #11345
Commits on Aug 23, 2023
-
fix: closes pytest-dev#11343's [attr-defined] type errors
On Windows 10.0.19045, the mypy hook is failing on pre-commit because of two [attr-defined] errors, which prevents me from staging stages. The problem was first reported in pytest-dev#11343. This PR solves the problem by adding `type ignore` comments to the erroring lines: ``` src\_pytest\compat.py:324: error: Module has no attribute "getuid"; maybe "getpid" or "getppid"? [attr-defined] testing\test_parseopt.py:294: error: Module has no attribute "getencoding" [attr-defined] ```
Configuration menu - View commit details
-
Copy full SHA for 2a91c63 - Browse repository at this point
Copy the full SHA 2a91c63View commit details
Commits on Aug 24, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 7600243 - Browse repository at this point
Copy the full SHA 7600243View commit details -
Configuration menu - View commit details
-
Copy full SHA for 15ebcf5 - Browse repository at this point
Copy the full SHA 15ebcf5View commit details
Commits on Aug 25, 2023
-
Merge branch 'add-type-ignore-for-attr-defined-errors' of https://git…
…hub.com/WarrenTheRabbit/pytest into add-type-ignore-for-attr-defined-errors
Configuration menu - View commit details
-
Copy full SHA for fe67feb - Browse repository at this point
Copy the full SHA fe67febView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d5bfa8 - Browse repository at this point
Copy the full SHA 2d5bfa8View commit details
Commits on Aug 26, 2023
-
refactor: self-document error flag with a constant
The previous implementation required the caller to have knowledge of its platform's `getuid` error code. Although this had the benefit of replacing a hard-coded error value with a descriptive variable, the attempt at future proofing `get_user_id` was flagged as a poor design decision by Nicoddemus: to future proof the function, `get_user_id` should determine the error flag internally. However, future-proofing was not the reason the issue was opened. The issue was opened to resolve an `[attr-defined]` error on Windows platforms caused by *mypy*'s handling of code reachability through platform checks. Over the course of the open issue, additional housekeeping tasks were also undertaken: - adding a comment that links to an explanation of *mypy*'s platform and version checking requirements - adding a variable name and comment to clarify the reason for the conditional return `return uid if uid . . .`
Configuration menu - View commit details
-
Copy full SHA for f9aa628 - Browse repository at this point
Copy the full SHA f9aa628View commit details
Commits on Aug 27, 2023
-
doc: improve explanation of return values
It is misleading to say that None is returned because the uid is unreliable. That implies that a uid of uknown integrity was retrieved. More accurately, and across all platforms, None indicates that no such id was determined.
Configuration menu - View commit details
-
Copy full SHA for af4ebeb - Browse repository at this point
Copy the full SHA af4ebebView commit details -
refactor: change name of self-documenting constant
The previous constant name implied that a user id was returned and that it cannot be relied upon. That is not the case. -1 is an error flag and the constant should identify it as such.
Configuration menu - View commit details
-
Copy full SHA for 60f6566 - Browse repository at this point
Copy the full SHA 60f6566View commit details -
doc: remove unwanted implication
Returning None does not mean that all future calls to the underlying platform will result in a return value of None. It is a certainty for win32 and Emscripten platforms but only a possibility for other platforms. The documentation should only state that the *current* call to the underlying platform was unsuccessful.
Configuration menu - View commit details
-
Copy full SHA for c7b602c - Browse repository at this point
Copy the full SHA c7b602cView commit details