From 60f65668ed73b1b871e5a28a9628bac6021d57e6 Mon Sep 17 00:00:00 2001 From: Warren Date: Sun, 27 Aug 2023 10:29:50 +1000 Subject: [PATCH] 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. --- src/_pytest/compat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index bf86de4cc..344b2c847 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -329,9 +329,9 @@ def get_user_id() -> int | None: else: # On other platforms, a return value of -1 is assumed to indicate that # the current process's real user id cannot be determined. - UNRELIABLE = -1 + ERROR = -1 uid = os.getuid() - return uid if uid != UNRELIABLE else None + return uid if uid != ERROR else None # Perform exhaustiveness checking.