(
scope_callable: Callable[[str, Config], ScopeName],
fixture_name: str,
config: Config,
)
| 1025 | |
| 1026 | |
| 1027 | def _eval_scope_callable( |
| 1028 | scope_callable: Callable[[str, Config], ScopeName], |
| 1029 | fixture_name: str, |
| 1030 | config: Config, |
| 1031 | ) -> ScopeName: |
| 1032 | try: |
| 1033 | # Type ignored because there is no typing mechanism to specify |
| 1034 | # keyword arguments, currently. |
| 1035 | result = scope_callable(fixture_name=fixture_name, config=config) # type: ignore[call-arg] |
| 1036 | except Exception as e: |
| 1037 | raise TypeError( |
| 1038 | f"Error evaluating {scope_callable} while defining fixture '{fixture_name}'.\n" |
| 1039 | "Expected a function with the signature (*, fixture_name, config)" |
| 1040 | ) from e |
| 1041 | if not isinstance(result, str): |
| 1042 | fail( |
| 1043 | f"Expected {scope_callable} to return a 'str' while defining fixture '{fixture_name}', but it returned:\n" |
| 1044 | f"{result!r}", |
| 1045 | pytrace=False, |
| 1046 | ) |
| 1047 | return result |
| 1048 | |
| 1049 | |
| 1050 | class FixtureDef(Generic[FixtureValue]): |
no outgoing calls
no test coverage detected
searching dependent graphs…