1

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

Sudip Neupane
  • 33
  • 1
  • 9
  • I'm having the same issue and haven't found a fix yet. Oddly enough this only happens with Python 3.11 for me, switching back to Python 3.10 or 3.9 doesn't have this issue. Is that the same for you? I suspect this is another Python 3.11 bug in PyCharm. – rurp Aug 04 '23 at 21:44

0 Answers0