Getting Fixture Not found while running or debuging from UI but No issue while running via terminal pycharm

177 Views Asked by At

when i run or debug a test in pytest, i got following error

def test_session_start_recording_post(self, user_token): E fixture 'user_token' not found

  available fixtures: _session_faker, _xunit_setup_class_fixture_Test_Session_Create_Start_join, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, extra, faker, include_metadata_in_junit_xml, json_metadata, metadata, 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.

Blockquote

but when i run test via terminal it runs and collect test and runs

cachedir: .pytest_cache metadata: {'Python': '3.11.0rc1', 'Platform': 'Linux-5.19.0-46-generic-x86_64-with-glibc2.35', 'Packages': {'pytest': '7.4.0', 'pluggy': '1.2.0'}, 'Plugins': {'Faker': '18.11.2', 'metadata': '3.0.0', 'html': '3.2.0', 'json-report': '1.5.0', 'excel': '1.5.0'}} rootdir: <test_directory> plugins: Faker-18.11.2, metadata-3.0.0, html-3.2.0, json-report-1.5.0, excel-1.5.0 collected 6 items

0

There are 0 best solutions below