aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/pytest/py3/_pytest/scope.py
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2025-05-05 12:31:52 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2025-05-05 12:41:33 +0300
commit6ff49ec58061f642c3a2f83c61eba12820787dfc (patch)
treec733ec9bdb15ed280080d31dea8725bfec717acd /contrib/python/pytest/py3/_pytest/scope.py
parenteefca8305c6a545cc6b16dca3eb0d91dcef2adcd (diff)
downloadydb-6ff49ec58061f642c3a2f83c61eba12820787dfc.tar.gz
Intermediate changes
commit_hash:8b3bb826b17db8329ed1221f545c0645f12c552d
Diffstat (limited to 'contrib/python/pytest/py3/_pytest/scope.py')
-rw-r--r--contrib/python/pytest/py3/_pytest/scope.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/contrib/python/pytest/py3/_pytest/scope.py b/contrib/python/pytest/py3/_pytest/scope.py
index 7a746fb9fa9..2c6e23208f2 100644
--- a/contrib/python/pytest/py3/_pytest/scope.py
+++ b/contrib/python/pytest/py3/_pytest/scope.py
@@ -7,15 +7,14 @@ would cause circular references.
Also this makes the module light to import, as it should.
"""
+
from enum import Enum
from functools import total_ordering
+from typing import Literal
from typing import Optional
-from typing import TYPE_CHECKING
-if TYPE_CHECKING:
- from typing_extensions import Literal
- _ScopeName = Literal["session", "package", "module", "class", "function"]
+_ScopeName = Literal["session", "package", "module", "class", "function"]
@total_ordering
@@ -33,11 +32,11 @@ class Scope(Enum):
"""
# Scopes need to be listed from lower to higher.
- Function: "_ScopeName" = "function"
- Class: "_ScopeName" = "class"
- Module: "_ScopeName" = "module"
- Package: "_ScopeName" = "package"
- Session: "_ScopeName" = "session"
+ Function: _ScopeName = "function"
+ Class: _ScopeName = "class"
+ Module: _ScopeName = "module"
+ Package: _ScopeName = "package"
+ Session: _ScopeName = "session"
def next_lower(self) -> "Scope":
"""Return the next lower scope."""
@@ -60,7 +59,7 @@ class Scope(Enum):
@classmethod
def from_user(
- cls, scope_name: "_ScopeName", descr: str, where: Optional[str] = None
+ cls, scope_name: _ScopeName, descr: str, where: Optional[str] = None
) -> "Scope":
"""
Given a scope name from the user, return the equivalent Scope enum. Should be used