Skip to content

0.2.1: test suite is using deprecated nose module and pytest is failing in one unit #46

Open
@kloczek

Description

@kloczek

Looks like traittypes is one onf the only few modules still using nose wich is no longer maintained and should not be used with python 3.x https://nose.readthedocs.io/en/latest/

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-traittypes-0.2.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-traittypes-0.2.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.1, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/traittypes-0.2.1
collected 25 items / 1 error

================================================================================== ERRORS ==================================================================================
_________________________________________________________ ERROR collecting traittypes/tests/test_import_errors.py __________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/traittypes-0.2.1/traittypes/tests/test_import_errors.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
traittypes/tests/test_import_errors.py:2: in <module>
    import nose.tools as nt
E   ModuleNotFoundError: No module named 'nose'
============================================================================= warnings summary =============================================================================
traittypes/traittypes.py:20
  /home/tkloczko/rpmbuild/BUILD/traittypes-0.2.1/traittypes/traittypes.py:20: DeprecationWarning:
              Sentinel is not a public part of the traitlets API.
              It was published by mistake, and may be removed in the future.

    Empty = Sentinel('Empty', 'traittypes',

../../../../../usr/lib/python3.8/site-packages/traitlets/tests/test_traitlets.py:1740
  /usr/lib/python3.8/site-packages/traitlets/tests/test_traitlets.py:1740: DeprecationWarning: Keyword `trait` is deprecated in traitlets 5.0, use `value_trait` instead
    value = Dict(trait=Unicode(),

../../../../../usr/lib/python3.8/site-packages/traitlets/tests/test_traitlets.py:1755
  /usr/lib/python3.8/site-packages/traitlets/tests/test_traitlets.py:1755: DeprecationWarning: Keyword `traits` is deprecated in traitlets 5.0, use `per_key_traits` instead
    value = Dict(traits={'foo': Int()},

../../../../../usr/lib/python3.8/site-packages/traitlets/tests/test_traitlets.py:1785
  /usr/lib/python3.8/site-packages/traitlets/tests/test_traitlets.py:1785: DeprecationWarning: Keyword `trait` is deprecated in traitlets 5.0, use `value_trait` instead
    value = Dict(trait=Unicode(),

../../../../../usr/lib/python3.8/site-packages/traitlets/tests/test_traitlets.py:1785
  /usr/lib/python3.8/site-packages/traitlets/tests/test_traitlets.py:1785: DeprecationWarning: Keyword `traits` is deprecated in traitlets 5.0, use `per_key_traits` instead
    value = Dict(trait=Unicode(),

traittypes/tests/test_traittypes.py:20
  /home/tkloczko/rpmbuild/BUILD/traittypes-0.2.1/traittypes/tests/test_traittypes.py:20: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    value = Array().tag(dtype=np.int)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= short test summary info ==========================================================================
ERROR traittypes/tests/test_import_errors.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================================= 6 warnings, 1 error in 0.68s =======================================================================

On migration from nose to pytest can be used https://github.com/schollii/nose2pytest/
In above output it is possible to as well see few warnings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions