Welcome to the Linux Foundation Forum!

Lab 7: nosetests fails

Options
simonzn
simonzn Posts: 3
edited May 3 in LFS261 Class Forum

The pipeline for the vote app fails with

+ nosetests -v
Traceback (most recent call last):
  File "/usr/local/bin/nosetests", line 8, in <module>
    sys.exit(run_exit())
             ^^^^^^^^^^
[...]
  File "/usr/local/lib/python3.11/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'

Reason: nosetests is no longer maintained and incompatible with Python 3.9 or later (https://github.com/nose-devs/nose/issues/1099

The simple fix to continue the lab is to use https://pypi.org/project/pynose/ instead. However, it seems the recommended way would be to migrate the tests to pytest.

Comments

  • luisviveropena
    luisviveropena Posts: 1,282

    Hi @simonzn,

    Can you indicate the section name of Lab 7 that you are working on, please?

    Regards,
    Luis.

  • simonzn
    simonzn Posts: 3

    The Exercise; integration for the vote app fail with the error mentioned above.

Categories

Upcoming Training