| 955 | |
| 956 | |
| 957 | class FixtureLookupErrorRepr(TerminalRepr): |
| 958 | def __init__( |
| 959 | self, |
| 960 | filename: str | os.PathLike[str], |
| 961 | firstlineno: int, |
| 962 | tblines: Sequence[str], |
| 963 | errorstring: str, |
| 964 | argname: str | None, |
| 965 | ) -> None: |
| 966 | self.tblines = tblines |
| 967 | self.errorstring = errorstring |
| 968 | self.filename = filename |
| 969 | self.firstlineno = firstlineno |
| 970 | self.argname = argname |
| 971 | |
| 972 | def toterminal(self, tw: TerminalWriter) -> None: |
| 973 | # tw.line("FixtureLookupError: %s" %(self.argname), red=True) |
| 974 | for tbline in self.tblines: |
| 975 | tw.line(tbline.rstrip()) |
| 976 | lines = self.errorstring.split("\n") |
| 977 | if lines: |
| 978 | tw.line( |
| 979 | f"{ExceptionInfoFormatter.fail_marker} {lines[0].strip()}", |
| 980 | red=True, |
| 981 | ) |
| 982 | for line in lines[1:]: |
| 983 | tw.line( |
| 984 | f"{ExceptionInfoFormatter.flow_marker} {line.strip()}", |
| 985 | red=True, |
| 986 | ) |
| 987 | tw.line() |
| 988 | tw.line(f"{os.fspath(self.filename)}:{self.firstlineno + 1}") |
| 989 | |
| 990 | |
| 991 | def call_fixture_func( |