Skip to content

Commit 0e734c7

Browse files
committed
config: add a couple of explicit Anys
pyright (somewhat annoyingly IMO) infers unannotated function types, unlike mypy which treats them as `Any`. In these 2 cases it causes some follow on type errors, so add explicit `Any`s to prevent pyright from inferring some big union.
1 parent 69c47ce commit 0e734c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/_pytest/config/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ def addinivalue_line(self, name: str, line: str) -> None:
15821582
assert isinstance(x, list)
15831583
x.append(line) # modifies the cached list inline
15841584

1585-
def getini(self, name: str):
1585+
def getini(self, name: str) -> Any:
15861586
"""Return configuration value from an :ref:`ini file <configfiles>`.
15871587
15881588
If a configuration value is not defined in an
@@ -1726,7 +1726,7 @@ def _get_override_ini_value(self, name: str) -> str | None:
17261726
value = user_ini_value
17271727
return value
17281728

1729-
def getoption(self, name: str, default=notset, skip: bool = False):
1729+
def getoption(self, name: str, default: Any = notset, skip: bool = False):
17301730
"""Return command line option value.
17311731
17321732
:param name: Name of the option. You may also specify

0 commit comments

Comments
 (0)