ERROR at setup of test_atlas_setup

I have basically connected to atlast but test run is failing and hence i am not able to run the application
properly.

on running the pytest -m connection the following output is received

(base) C:\Users\Namish\mflix-python>pytest -m connection
============================= test session starts =============================
platform win32 – Python 3.7.0, pytest-3.8.0, py-1.6.0, pluggy-0.7.1
rootdir: C:\Users\Namish\mflix-python, inifile: pytest.ini
plugins: remotedata-0.3.0, openfiles-0.3.0, doctestplus-0.1.3, arraydiff-0.2
collected 43 items / 39 deselected

tests\test_db_connection.py EEEE [100%]

=================================== ERRORS ====================================
_____________________ ERROR at setup of test_atlas_setup ______________________
file C:\Users\Namish\mflix-python\tests\test_db_connection.py, line 21
@pytest.mark.connection
@pytest.mark.usefixtures(‘config’)
def test_atlas_setup(client, config):
E fixture ‘config’ not found

  available fixtures: app, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_xml_attribute, record_xml_property, recwarn, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

C:\Users\Namish\mflix-python\tests\test_db_connection.py:21
_____________________ ERROR at setup of test_basic_movies _____________________
file C:\Users\Namish\mflix-python\tests\test_db_connection.py, line 29
@pytest.mark.connection
def test_basic_movies(client):
E fixture ‘client’ not found

  available fixtures: app, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_xml_attribute, record_xml_property, recwarn, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

C:\Users\Namish\mflix-python\tests\test_db_connection.py:29
__________________ ERROR at setup of test_search_by_movie_id __________________
file C:\Users\Namish\mflix-python\tests\test_db_connection.py, line 36
@pytest.mark.connection
def test_search_by_movie_id(client):
E fixture ‘client’ not found

  available fixtures: app, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_xml_attribute, record_xml_property, recwarn, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

C:\Users\Namish\mflix-python\tests\test_db_connection.py:36
__________________ ERROR at setup of test_simple_text_search __________________
file C:\Users\Namish\mflix-python\tests\test_db_connection.py, line 42
@pytest.mark.connection
def test_simple_text_search(client):
E fixture ‘client’ not found

  available fixtures: app, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_xml_attribute, record_xml_property, recwarn, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

C:\Users\Namish\mflix-python\tests\test_db_connection.py:42
=================== 39 deselected, 4 error in 0.25 seconds ====================

Can you try doing this? Let me know if it works.

Kanika

Just tested this with the default dnspython 1.15.0 and it succeeded.

It looks like it’s not recognising the tests/conftest.py file and it appears that you have a different version of pytest than what is specified in the requirements.txt file (unless it’s changed).

  1. Share a screenshot of requirements.txt

  2. Did you run “pip install -r requirements.txt” as per the instructions?

  3. Using code tags (see screenshot below), share the output of:
    pytest tests/test_db_connection.py --fixtures

  4. Inside the tests/__pycache__ folder, delete all the files beginning with:

    __init__.cpython
    conftest.cpython
    test_db_connection.cpython
    

    … and try to run the test again.

Code tags:
image

Hello team,
Thanks for the updates and guidance.

Will check the same on my system and let you know wether it worked.

Thanks

1 Like