base path for feature files
This commit is contained in:
parent
528a36d81e
commit
106e5633db
|
@ -25,12 +25,7 @@ def scenario(feature_name, scenario_name):
|
|||
|
||||
def _scenario(request):
|
||||
# Get the feature
|
||||
try:
|
||||
base_path = request.getfuncargvalue('pytest_bdd_feature_path')
|
||||
except LookupError:
|
||||
# TODO: add concrete exception type, for now it's not clear how to import FixtureLookupErrorRepr from pytest
|
||||
base_path = op.dirname(request.module.__file__)
|
||||
|
||||
base_path = request.getfuncargvalue('pytestbdd_feature_path')
|
||||
feature_path = op.abspath(op.join(base_path, feature_name))
|
||||
feature = Feature.get_feature(feature_path)
|
||||
|
||||
|
|
6
setup.py
6
setup.py
|
@ -29,6 +29,12 @@ setup(
|
|||
install_requires=[
|
||||
'pytest',
|
||||
],
|
||||
# the following makes a plugin available to py.test
|
||||
entry_points = {
|
||||
'pytest11': [
|
||||
'pytest-bdd = pytest_bdd.plugin',
|
||||
]
|
||||
},
|
||||
tests_require=['mock'],
|
||||
packages=['pytest_bdd'],
|
||||
)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""Configuration for pytest runner."""
|
||||
|
||||
from pytest_bdd import given, when
|
||||
from pytest_bdd.plugin import pytestbdd_feature_path
|
||||
|
||||
pytest_plugins = 'pytester'
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ def scenario_name(request):
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
def pytest_bdd_feature_path():
|
||||
def pytestbdd_feature_path():
|
||||
return '/does/not/exist'
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue