Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
yurivict opened this issue Apr 6, 2024 · 5 comments

Comments

@yurivict
Copy link

yurivict commented Apr 6, 2024

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
Copy link
Owner

boxed commented Apr 6, 2024

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.

@boxed boxed closed this as completed Apr 6, 2024
@yurivict
Copy link
Author

yurivict commented Apr 6, 2024

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
Copy link
Author

yurivict commented Apr 6, 2024

@boxed

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

@boxed
Copy link
Owner

boxed commented Apr 6, 2024

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
Copy link
Author

yurivict commented Apr 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants