Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New version of pytest-bdd requires some updates #3

Open
rnwolf opened this issue Jan 2, 2021 · 0 comments
Open

New version of pytest-bdd requires some updates #3

rnwolf opened this issue Jan 2, 2021 · 0 comments

Comments

@rnwolf
Copy link

rnwolf commented Jan 2, 2021

Hi

When using pytest-bdd==3.2.1
as seen in article in http://www.datio.com/bbdd/behavior-driver-development-with-python-a-humble-introduction/
I can get pytest passing for file step_1/tests/test_serving.py

but when using the current pytest-bdd version 4.0.2 I get an error. Something has changed, most probably trival for you to update, but unfortunately I am not at that level of understanding yet.

Any tips on what I could do to get your example working with the 4.x versions of pytest-bdd?

(.venv) C:\Users\rnwol\workspace\bdd-salt-shaker>python -m pytest step_1/tests
================================================================================================================= test session starts =================================================================================================================
platform win32 -- Python 3.8.6, pytest-6.2.1, py-1.10.0, pluggy-0.13.1
rootdir: C:\Users\rnwol\workspace\bdd-salt-shaker
plugins: bdd-4.0.2
collected 1 item                                                                                                                                                                                                                                       

step_1\tests\test_serving.py F                                                                                                                                                                                                                   [100%]

====================================================================================================================== FAILURES =======================================================================================================================
_________________________________________________________________________________________________________________ test_single_service _________________________________________________________________________________________________________________
file C:\Users\rnwol\workspace\bdd-salt-shaker\.venv\lib\site-packages\pytest_bdd\scenario.py, line 175
          @pytest.mark.usefixtures(*function_args)
          def scenario_wrapper(request):
E       fixture 'salt_shaker' not found
>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestbdd_given_A Salt Shaker, pytestbdd_given_trace, pytestbdd_then_A salt dose falls on my plate, pytestbdd_then_trace, pytestbdd
_when_I shake it once, pytestbdd_when_trace, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, served, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

C:\Users\rnwol\workspace\bdd-salt-shaker\.venv\lib\site-packages\pytest_bdd\scenario.py:175
=============================================================================================================== short test summary info ===============================================================================================================
FAILED step_1/tests/test_serving.py::test_single_service
================================================================================================================== 1 failed in 0.04s ==================================================================================================================

(.venv) C:\Users\rnwol\workspace\bdd-salt-shaker>

It seems that the current version @given requires one to specify a , target_fixture= but I then start to go down a rabbit hole.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant