Skip to content

Commit 962f277

Browse files
author
Ludovic CHAPELET
committed
chore: replace error by proper typing
1 parent 9af673c commit 962f277

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pytest_bdd/parser.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,12 @@ def render(self, context: Mapping[str, object]) -> Scenario:
233233
rule=self.rule,
234234
)
235235

236-
def find_scenario_example_from_context(self, context: Mapping[str, object]) -> Examples:
236+
def find_scenario_example_from_context(self, context: Mapping[str, object]) -> Examples | None:
237237
for example in self.examples:
238238
example_param = dict(zip(example.example_params, example.examples[0]))
239239
if example_param == context:
240240
return example
241-
raise ValueError("No matching example found for the given context.")
241+
return None
242242

243243

244244
@dataclass(eq=False)

0 commit comments

Comments
 (0)