features/stepsto be present in the
sys.path? I have split some code in
features/steps/steps.pyoff into a separate module
zotero.pyin the same directory, and that's not being picked up when I do
import zotero. It does work when I add
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'steps')))at the top of
environment.py, but if that's superfluous and I've just made a setup error, it'd be better without.
from . import zoterobut that didn't work when I tried. Should that have worked? I have all my code in the
stepsdirectory currently, except the
environment.pyfile which didn't seem to get picked up anywhere but in the
$ find features -type f features/steps/zotero.py features/steps/steps.py features/steps/__init__.py features/steps/preferences.toml features/steps/__pycache__/environment.cpython-37.pyc features/steps/__pycache__/zotero.cpython-37.pyc features/steps/__pycache__/__init__.cpython-37.pyc features/steps/environment.py features/environment.py features/import.feature features/export.feature
environment.py. It should look clean and just contain what Behave needs to run. Take a look at this example: behave-django / tests / acceptance / environment.py (you don't need
pathsin the behave configuration, but this is mainly because we have BDD tests in two different places.
PYTHONPATH=$PYTHONPATH:$(pwd)/features/steps behavebut that seems strange, and (perhaps unrelatedly) that failed when I tried it on Travis, saying it couldn't find the module.
behave.ini, and have an
tests, behave would load features from
tests/stuff.pywould be importable as
tests.stuff, or perhaps
stuff? I see
from test_app.models import BehaveTestModel, and
tests/test_appis named in
tox.iniof the project.
Formatter must be importable from python search path.. Is that the general python search path, or the python search path with the paths from
def before_scenario(context, scenario): """ Hanlder before the test scenario is run """ logging.info("Starting Scenario: %s", scenario.name) if scenario.name == 'Test PGaaS Product': use_fixture(provision_product, context) @capture def before_step(context, step): """ Handler before the test step is run """ logging.info("Starting Step: %s", step.name) if step.name == 'Create a clone of the cluster': use_fixture(provision_clone, context)
for row in context.example: print(row)