From fc702ab7e41a583b0b0658aa2bf7c962a19d3fe7 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 10 Jul 2020 00:50:10 +0300 Subject: [PATCH] fixtures: some type annotations --- src/_pytest/fixtures.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index cedcd4625..52dc78b63 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -809,7 +809,9 @@ def scope2index(scope: str, descr: str, where: Optional[str] = None) -> int: class FixtureLookupError(LookupError): """ could not return a requested Fixture (missing or invalid). """ - def __init__(self, argname, request, msg: Optional[str] = None) -> None: + def __init__( + self, argname: Optional[str], request: FixtureRequest, msg: Optional[str] = None + ) -> None: self.argname = argname self.request = request self.fixturestack = request._get_fixturestack() @@ -861,7 +863,14 @@ class FixtureLookupError(LookupError): class FixtureLookupErrorRepr(TerminalRepr): - def __init__(self, filename, firstlineno, tblines, errorstring, argname): + def __init__( + self, + filename: Union[str, py.path.local], + firstlineno: int, + tblines: Sequence[str], + errorstring: str, + argname: Optional[str], + ) -> None: self.tblines = tblines self.errorstring = errorstring self.filename = filename