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

1.0.7: pytest is failing #1289

Closed
kloczek opened this issue Oct 11, 2021 · 8 comments
Closed

1.0.7: pytest is failing #1289

kloczek opened this issue Oct 11, 2021 · 8 comments
Labels

Comments

@kloczek
Copy link

kloczek commented Oct 11, 2021

I'm trying to package your module as an rpm package. So I'm using the typical build, install and test cycle used on building packages from non-root account.

  • "setup.py build"
  • "setup.py install --root </install/prefix>"
  • "pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

Looks like pytest shows some deprecion errors

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/solaar-1.0.7-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/solaar-1.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=1129729643
rootdir: /home/tkloczko/rpmbuild/BUILD/Solaar-1.0.7
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, aspectlib-1.5.2, toolbox-0.5, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, flaky-3.7.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, xprocess-0.18.1, black-0.3.12, asyncio-0.15.1, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6, mock-3.6.1, profiling-1.7.0, randomly-3.8.0, nose2pytest-1.0.8, pyfakefs-4.5.1, tornado-0.8.1, twisted-1.13.3, aiohttp-0.3.0, localserver-0.5.0, anyio-3.3.1, trio-0.7.0, cases-3.6.4, yagot-0.5.0, Faker-9.2.0, relaxed-1.1.5
collected 0 items / 1 error

================================================================================== ERRORS ==================================================================================
______________________________________________________________________ ERROR collecting test session _______________________________________________________________________
Direct construction of SpecModule has been deprecated, please use SpecModule.from_parent.
See https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent for more details.
========================================================================= short test summary info ==========================================================================
ERROR
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================= 1 error in 0.29s =============================================================================
pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo(<process_name>).terminate()'.
@kloczek kloczek added the bug label Oct 11, 2021
@pfps
Copy link
Collaborator

pfps commented Oct 11, 2021

What is pytest complaining about? I've never used it so I have no idea what is going on.

@kloczek
Copy link
Author

kloczek commented Oct 12, 2021

Just please check https://docs.pytest.org/en/stable/deprecations.html

@rathann
Copy link
Contributor

rathann commented Oct 12, 2021

@kloczek We have solaar packaged in Fedora already. If you have some improvements for the package, please send a PR, patch or open a bug.

@pfps
Copy link
Collaborator

pfps commented Oct 12, 2021

It looks as if these are pytest things that have been deprecated. But Sollaar doesn't have any pytest stuff in it, so I'm not sure what could be changed in Solaar to fix any of this.

@kloczek
Copy link
Author

kloczek commented Oct 12, 2021

Indeed. Only few minutes ago I found that exactly that error output was caused by pytest-runner module.
Without that module pytest shows:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/solaar-1.0.7-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/solaar-1.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=3480172295
rootdir: /home/tkloczko/rpmbuild/BUILD/Solaar-1.0.7
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, aspectlib-1.5.2, toolbox-0.5, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, flaky-3.7.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, xprocess-0.18.1, black-0.3.12, asyncio-0.15.1, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6, mock-3.6.1, profiling-1.7.0, randomly-3.8.0, nose2pytest-1.0.8, pyfakefs-4.5.1, tornado-0.8.1, twisted-1.13.3, aiohttp-0.3.0, localserver-0.5.0, anyio-3.3.1, trio-0.7.0, cases-3.6.4, yagot-0.5.0, Faker-9.2.0
collected 0 items

========================================================================== no tests ran in 0.16s ===========================================================================
pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo(<process_name>).terminate()'.

Nevertheless IMO if Solaar still would be pythomn code application it would be good to add some pytest support.

Closing.

BTW. did you think about rewrite Solaar as native gnome-shell JS extension?

@kloczek kloczek closed this as completed Oct 12, 2021
@pfps
Copy link
Collaborator

pfps commented Oct 12, 2021

See Issue #1097 for the request to add testing to Solaar.

Turning Solaar into JS would require writing a daemon to do the low-level device control, I think. This was in the works, but I don't think much has happened there.

@kloczek
Copy link
Author

kloczek commented Oct 12, 2021

Theoretically it should be possible to do that witou running constantly dedicated proces and using only dbus .. (I think ..)

@pfps
Copy link
Collaborator

pfps commented Oct 12, 2021

Yes, it is somewhat wasteful to have Solaar responding to regular input from devices.

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

No branches or pull requests

3 participants