boxed / mutmut

Mutation testing system
https://mutmut.readthedocs.io
BSD 3-Clause "New" or "Revised" License
902 stars 109 forks source link

Tests require the 'testdata' feature but it isn't listed in test_requirements.txt #315

Closed yurivict closed 6 months ago

yurivict commented 6 months ago

Some tests fail w/out it:

_____________________________________________________________ ERROR at setup of test_read_patch_data_edited_line_is_in_the_list _____________________________________________________________
file /usr/ports/devel/py-mutmut/work-py39/mutmut-2.4.5/tests/test_init.py, line 131
  def test_read_patch_data_edited_line_is_in_the_list(testpatches_path: Path):
file /usr/ports/devel/py-mutmut/work-py39/mutmut-2.4.5/tests/test_init.py, line 82
  @fixture
  def testpatches_path(testdata: Path):
E       fixture 'testdata' not found
>       available fixtures: anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testpatches_path, testrun_uid, time_machine, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, weave, worker_id
>       use 'pytest --fixtures [testpath]' for help on them.

/usr/ports/devel/py-mutmut/work-py39/mutmut-2.4.5/tests/test_init.py:82
______________________________________________________ ERROR at setup of test_read_patch_data_renamed_file_edited_line_is_in_the_list _______________________________________________________
file /usr/ports/devel/py-mutmut/work-py39/mutmut-2.4.5/tests/test_init.py, line 143
  def test_read_patch_data_renamed_file_edited_line_is_in_the_list(testpatches_path: Path):
file /usr/ports/devel/py-mutmut/work-py39/mutmut-2.4.5/tests/test_init.py, line 82
  @fixture
  def testpatches_path(testdata: Path):
E       fixture 'testdata' not found
>       available fixtures: anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testpatches_path, testrun_uid, time_machine, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, weave, worker_id
>       use 'pytest --fixtures [testpath]' for help on them.

Version: 2.4.5 Python-3.9 FreeBSD 14.0

boxed commented 6 months ago

You must be running the tests incorrectly or something. testdata is not a feature, it's a FIXTURE, and it's defined in tests/conftest.py. I don't see why your test run fails.

This looks like some ports work for including mutmut in a distribution. Might I suggest just not doing this? You're just wasting your time. Let python tools work through the python ecosystem.

yurivict commented 6 months ago

This looks like some ports work for including mutmut in a distribution. Might I suggest just not doing this? You're just wasting your time. Let python tools work through the python ecosystem.

This only works on Linux. And in general this would fail for many reasons.

(1) Many Python ports contain binaries, FreeBSD versions of which aren't available from Python wheels that are downloaded. Some packages would just fail to install using only the Python infrastructure. (2) Some C++ and other packages depend on Python commands using some other Pythin packages. Such ports would fail to build.

Real-world situation is just much more complex and mirroring Python packages as ports is needed for users to be able to reliably use these and other packages on FreeBSD. BTW, same happens in Linux distros.

yurivict commented 6 months ago

@boxed

There is no tests/conftest.py in the tarball downloaded from PYPI.

boxed commented 6 months ago

There is no C or other dependency or whatever here.

Anyway, if you want to send a PR for fixing the pypi release then I'll merge it.

yurivict commented 6 months ago

I never did any pypi releases, so I don't know how to fix it.