You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of the tests in test_mirror.py and test_vlan.py are skipped for Debian 8.9 or before by using the following line:
@pytest.mark.skipif(StrictVersion(distro.linux_distribution()[1]) <= StrictVersion('8.9'), reason="Debian 8.9 or before has no support")
Some Debian release versions are simple integers (e.g., 10, 11, 12, etc.). Running these tests on such Debian releases causes the constructor of StrictVersion to raise a ValueError, because it does not accept simple integers.
For example, I tried to run the tests on Debian 11 (bullseye) using the command sudo python3 -m py.test and received the following errors:
======================================================== ERRORS ========================================================
___________________________________________ ERROR collecting test_mirror.py ____________________________________________
test_mirror.py:10: in <module>
class TestMirror(object):
test_mirror.py:382: in TestMirror
???
/usr/lib/python3.9/distutils/version.py:40: in __init__
self.parse(vstring)
/usr/lib/python3.9/distutils/version.py:137: in parse
raise ValueError("invalid version number '%s'" % vstring)
E ValueError: invalid version number '11'
____________________________________________ ERROR collecting test_vlan.py _____________________________________________
test_vlan.py:10: in <module>
class TestVlan(object):
test_vlan.py:161: in TestVlan
???
/usr/lib/python3.9/distutils/version.py:40: in __init__
self.parse(vstring)
/usr/lib/python3.9/distutils/version.py:137: in parse
raise ValueError("invalid version number '%s'" % vstring)
E ValueError: invalid version number '11'
The text was updated successfully, but these errors were encountered:
Also note that distro.linux_distribution() is deprecated:
>>> import distro
>>> distro.linux_distribution()[1]
<stdin>:1: DeprecationWarning: distro.linux_distribution() is deprecated. It should only be used as a compatibility shim with Python's platform.linux_distribution(). Please use distro.id(), distro.version() and distro.name() instead.
'22.04'
>>> distro.version()
'22.04'
Some of the tests in
test_mirror.py
andtest_vlan.py
are skipped for Debian 8.9 or before by using the following line:Some Debian release versions are simple integers (e.g., 10, 11, 12, etc.). Running these tests on such Debian releases causes the constructor of
StrictVersion
to raise aValueError
, because it does not accept simple integers.For example, I tried to run the tests on Debian 11 (bullseye) using the command
sudo python3 -m py.test
and received the following errors:The text was updated successfully, but these errors were encountered: