unittests broken with python 3.10 due to nose usage - nose needs to be removed

Bug #1990495 reported by Thomas Bechtold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
simplestreams
Fix Committed
Undecided
Alberto Contreras

Bug Description

Running "tox -epy3" with python 3.10 doesn't work:

$ tox -repy3
GLOB sdist-make: /home/tom/devel/simplestreams/setup.py
py3 recreate: /home/tom/devel/simplestreams/.tox/py3
py3 installdeps: coverage, mock, nose, python-glanceclient, python-keystoneclient
py3 inst: /home/tom/devel/simplestreams/.tox/.tmp/package/1/python-simplestreams-0.1.0.zip
py3 installed: attrs==22.1.0,certifi==2022.9.14,cffi==1.15.1,charset-normalizer==2.1.1,coverage==6.4.4,cryptography==38.0.1,debtcollector==2.5.0,idna==3.4,iso8601==1.0.2,jsonpatch==1.32,jsonpointer==2.3,jsonschema==4.16.0,keystoneauth1==5.0.0,mock==4.0.3,msgpack==1.0.4,netaddr==0.8.0,netifaces==0.11.0,nose==1.3.7,os-service-types==1.7.0,oslo.config==9.0.0,oslo.i18n==5.1.0,oslo.serialization==5.0.0,oslo.utils==6.0.1,packaging==21.3,pbr==5.10.0,prettytable==3.4.1,pycparser==2.21,pyOpenSSL==22.0.0,pyparsing==3.0.9,pyrsistent==0.18.1,python-glanceclient==4.1.0,python-keystoneclient==5.0.1,python-simplestreams @ file:///home/tom/devel/simplestreams/.tox/.tmp/package/1/python-simplestreams-0.1.0.zip,pytz==2022.2.1,PyYAML==6.0,requests==2.28.1,rfc3986==2.0.0,six==1.16.0,stevedore==4.0.0,urllib3==1.26.12,warlock==2.0.1,wcwidth==0.2.5,wrapt==1.14.1
py3 run-test-pre: PYTHONHASHSEED='1930872840'
py3 run-test: commands[0] | /home/tom/devel/simplestreams/tools/create-gpgdir
py3 run-test: commands[1] | /home/tom/devel/simplestreams/tools/sign-examples
py3 run-test: commands[2] | /home/tom/devel/simplestreams/.tox/py3/bin/python -m nose --with-coverage --cover-erase --cover-branches --cover-package=simplestreams --cover-inclusive tests
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/tom/devel/simplestreams/.tox/py3/lib/python3.10/site-packages/nose/__main__.py", line 8, in <module>
    run_exit()
  File "/home/tom/devel/simplestreams/.tox/py3/lib/python3.10/site-packages/nose/core.py", line 118, in __init__
    unittest.TestProgram.__init__(
  File "/usr/lib/python3.10/unittest/main.py", line 100, in __init__
    self.parseArgs(argv)
  File "/home/tom/devel/simplestreams/.tox/py3/lib/python3.10/site-packages/nose/core.py", line 179, in parseArgs
    self.createTests()
  File "/home/tom/devel/simplestreams/.tox/py3/lib/python3.10/site-packages/nose/core.py", line 193, in createTests
    self.test = self.testLoader.loadTestsFromNames(self.testNames)
  File "/home/tom/devel/simplestreams/.tox/py3/lib/python3.10/site-packages/nose/loader.py", line 481, in loadTestsFromNames
    return unittest.TestLoader.loadTestsFromNames(self, names, module)
  File "/usr/lib/python3.10/unittest/loader.py", line 220, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python3.10/unittest/loader.py", line 220, in <listcomp>
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/home/tom/devel/simplestreams/.tox/py3/lib/python3.10/site-packages/nose/loader.py", line 431, in loadTestsFromName
    return self.loadTestsFromModule(
  File "/home/tom/devel/simplestreams/.tox/py3/lib/python3.10/site-packages/nose/loader.py", line 354, in loadTestsFromModule
    tests.extend(self.loadTestsFromDir(module_path))
  File "/home/tom/devel/simplestreams/.tox/py3/lib/python3.10/site-packages/nose/loader.py", line 183, in loadTestsFromDir
    yield self.loadTestsFromName(
  File "/home/tom/devel/simplestreams/.tox/py3/lib/python3.10/site-packages/nose/loader.py", line 431, in loadTestsFromName
    return self.loadTestsFromModule(
  File "/home/tom/devel/simplestreams/.tox/py3/lib/python3.10/site-packages/nose/loader.py", line 359, in loadTestsFromModule
    return self.suiteClass(ContextList(tests, context=module))
  File "/home/tom/devel/simplestreams/.tox/py3/lib/python3.10/site-packages/nose/suite.py", line 428, in __call__
    return self.makeSuite(tests, context, **kw)
  File "/home/tom/devel/simplestreams/.tox/py3/lib/python3.10/site-packages/nose/suite.py", line 475, in makeSuite
    suite = self.suiteClass(
  File "/home/tom/devel/simplestreams/.tox/py3/lib/python3.10/site-packages/nose/suite.py", line 159, in __init__
    super(ContextSuite, self).__init__(tests)
  File "/home/tom/devel/simplestreams/.tox/py3/lib/python3.10/site-packages/nose/suite.py", line 53, in __init__
    super(LazySuite, self).__init__()
  File "/usr/lib/python3.10/unittest/suite.py", line 22, in __init__
    self._tests = []
  File "/home/tom/devel/simplestreams/.tox/py3/lib/python3.10/site-packages/nose/suite.py", line 106, in _set_tests
    if isinstance(tests, collections.Callable) and not is_suite:
AttributeError: module 'collections' has no attribute 'Callable'
ERROR: InvocationError for command /home/tom/devel/simplestreams/.tox/py3/bin/python -m nose --with-coverage --cover-erase --cover-branches --cover-package=simplestreams --cover-inclusive tests (exited with code 1)
_______________________________________________________________ summary ________________________________________________________________
ERROR: py3: commands failed

I think the problem is nose which is no longer maintained (last pypi release is from 2015).

Related branches

Changed in simplestreams:
status: New → Confirmed
Changed in simplestreams:
assignee: nobody → Alberto Contreras (aciba)
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.