Kozea/tinycss2

Test error flake8

Closed this issue · 8 comments

[ 60s] ============================= test session starts ==============================
[ 60s] platform linux -- Python 3.6.15, pytest-6.2.5, py-1.11.0, pluggy-0.13.1 -- /usr/bin/python3
[ 60s] cachedir: .pytest_cache
[ 60s] rootdir: /home/abuild/rpmbuild/BUILD/tinycss2-1.1.1, configfile: pyproject.toml
[ 60s] plugins: isort-0.3.1, flake8-1.0.4, cov-2.8.1
[ 60s] collecting ... collected 0 items / 1 error
[ 60s]
[ 60s] ==================================== ERRORS ====================================
[ 60s] ________________________ ERROR collecting test session _________________________
[ 60s] Direct construction of Flake8Item has been deprecated, please use Flake8Item.from_parent.
[ 60s] See https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent for more details.
[ 60s] =========================== short test summary info ============================
[ 60s] ERROR
[ 60s] !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
[ 60s] =============================== 1 error in 0.28s ===============================

liZe commented

Hello,

This error shows that, for some reason, pytest can’t collect tests. The deprecation warning is maybe related to this problem, but that’s a warning caused by the testing libraries, not tinycss2. Tests work correctly when launched by GitHub Actions.

Maybe some libraries don’t support Python 3.6 anymore, as its official support has been dropped one month ago?

The build is for openSUSE Leap 15.3/15.4, where Python 3.6 is still supported. So are all the depending packages are as well.
But the OpenBuild Service is quite picky...would you mind trying the new construction?
Thanks!

liZe commented

The build is for openSUSE Leap 15.3/15.4, where Python 3.6 is still supported. So are all the depending packages are as well.
But the OpenBuild Service is quite picky...would you mind trying the new construction?

Actually, we don’t use the old construction in tinycss2. It’s probably a problem of the version 1.0.4 of pytest-flake8 you use, fixed in 1.0.6. Upgrading pytest-flake8 to 1.0.6+ (or downgrading flake8 to 3.7-) should fix your problem.

pytest is v 6.2.5, python-flake8 is 3.7.7, tried upgrade to pytest-flake8 to 1.0.7, no success :-(

liZe commented

pytest is v 6.2.5, python-flake8 is 3.7.7, tried upgrade to pytest-flake8 to 1.0.7, no success :-(

Could you please post the output of the testing session with pytest-flake8 to 1.0.7?

Find it attached
log.txt

liZe commented
[    6s] ==================================== ERRORS ====================================
[    6s] ________________________ ERROR collecting test session _________________________
[    6s] Direct construction of IsortItem has been deprecated, please use IsortItem.from_parent.
[    6s] See https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent for more details.
[    6s] =========================== short test summary info ============================

The problem is the same as above, but with pytest-isort. Please update pytest-isort.

Yes, isort seem to fix it. Thanks for your help!