Pytest -m projection: assertion error

I am getting assertion error. To handle this I have added the following after “try:”
assert True
assert len(result) == 2
assert len(result) == 2420

image

Thanks in advance,

Partha Pratim Baruah

Do not modify the unit tests. Fix your code. If a unit test fail it is because your code is wrong.

(mflix) C:\Users\shanky\Desktop\mflix-python>pytest -m connection
============================= test session starts =============================
platform win32 – Python 3.7.1, pytest-4.0.2, py-1.7.0, pluggy-0.8.0
rootdir: C:\Users\shanky\Desktop\mflix-python, inifile:
plugins: remotedata-0.3.1, openfiles-0.3.1, doctestplus-0.2.0, arraydiff-0.3
collected 43 items / 39 deselected

tests\test_db_connection.py EEEE [100%]

=================================== ERRORS ====================================
_____________________ ERROR at setup of test_atlas_setup ______________________
file C:\Users\shanky\Desktop\mflix-python\tests\test_db_connection.py, line 21
@pytest.mark.connection
@pytest.mark.usefixtures(‘pytestconfig’)
def test_atlas_setup(client, config):
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, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

C:\Users\shanky\Desktop\mflix-python\tests\test_db_connection.py:21
_____________________ ERROR at setup of test_basic_movies _____________________
file C:\Users\shanky\Desktop\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, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

C:\Users\shanky\Desktop\mflix-python\tests\test_db_connection.py:29
__________________ ERROR at setup of test_search_by_movie_id __________________
file C:\Users\shanky\Desktop\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, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

C:\Users\shanky\Desktop\mflix-python\tests\test_db_connection.py:36
__________________ ERROR at setup of test_simple_text_search __________________
file C:\Users\shanky\Desktop\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, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

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

I would download the project again and follow the installation procedure.

I also have the same error message. can’t figure out where’s wrong with the installation. but I can run unit test with the follow:
http://localhost:5000/status

Might be with the dependencies. Please run pip install -r requirements.txt and if there is any error on the console output, please share here.

Kanika