Errors connecting in first section, not finding fixtures

I’m trying to get the first unit test, the one on connection running.
When I run pytest -m connection from the mflix-python directory, this is the result.
Would you know what’s going on?

========================================================= test session starts ==========================================================
platform linux -- Python 3.10.1, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: my_dir, configfile: pytest.ini
collected 43 items / 39 deselected / 4 selected                                                                                         

tests/test_db_connection.py EEEE                                                                                                  [100%]

================================================================ ERRORS =================================================================
__________________________________________________ ERROR at setup of test_atlas_setup ___________________________________________________
file my_dir/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_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

my_dir/tests/test_db_connection.py:21
__________________________________________________ ERROR at setup of test_basic_movies __________________________________________________
file my_dir/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_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

my_dir/tests/test_db_connection.py:29
_______________________________________________ ERROR at setup of test_search_by_movie_id _______________________________________________
file my_dir/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_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

my_dir/tests/test_db_connection.py:36
_______________________________________________ ERROR at setup of test_simple_text_search _______________________________________________
file my_dir/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_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

my_dir/tests/test_db_connection.py:42
======================================================== short test summary info ========================================================
ERROR tests/test_db_connection.py::test_atlas_setup
ERROR tests/test_db_connection.py::test_basic_movies
ERROR tests/test_db_connection.py::test_search_by_movie_id
ERROR tests/test_db_connection.py::test_simple_text_search

Hey @krithravi,

Welcome to MongoDB community forums!

From the error statements, it seems there could some error in your .ini file because of which it is you are unable to connect. Kindly recheck your file as well as please ensure proper permissions are in place in your Atlas. Do make sure to read the instructions of the lab to make sure everything is properly written in the .ini file.

I also know it’s been a super late reply and so if the problem has been resolved, do post to let us know what worked for you! This will certainly help other learners who may get the same error as you.

Regards,
Satyam

1 Like