15
15
import re
16
16
17
17
import pytest
18
-
19
- try :
20
- from _pytest import fixtures as pytest_fixtures
21
- except ImportError :
22
- from _pytest import python as pytest_fixtures
18
+ from _pytest .fixtures import FixtureLookupError
23
19
24
20
from . import exceptions
25
21
from .feature import get_feature , get_features
@@ -52,7 +48,7 @@ def find_argumented_step_fixture_name(name, type_, fixturemanager, request=None)
52
48
if request :
53
49
try :
54
50
request .getfixturevalue (parser_name )
55
- except pytest_fixtures . FixtureLookupError :
51
+ except FixtureLookupError :
56
52
continue
57
53
return parser_name
58
54
@@ -71,14 +67,14 @@ def _find_step_function(request, step, scenario):
71
67
try :
72
68
# Simple case where no parser is used for the step
73
69
return request .getfixturevalue (get_step_fixture_name (name , step .type ))
74
- except pytest_fixtures . FixtureLookupError :
70
+ except FixtureLookupError :
75
71
try :
76
72
# Could not find a fixture with the same name, let's see if there is a parser involved
77
73
name = find_argumented_step_fixture_name (name , step .type , request ._fixturemanager , request )
78
74
if name :
79
75
return request .getfixturevalue (name )
80
76
raise
81
- except pytest_fixtures . FixtureLookupError :
77
+ except FixtureLookupError :
82
78
raise exceptions .StepDefinitionNotFoundError (
83
79
f"Step definition is not found: { step } . "
84
80
f'Line { step .line_number } in scenario "{ scenario .name } " in the feature "{ scenario .feature .filename } "'
0 commit comments