Closed mbrukman closed 2 years ago
Looks like this is not so simple, as tests are failing with this error:
Run nose2 -v --pretty-assert
test_ipycache (nose2.loader.ModuleImportFailure) ... ERROR
======================================================================
ERROR: test_ipycache (nose2.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_ipycache
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/nose2/plugins/loader/discovery.py", line 201, in _find_tests_in_file
module = util.module_from_name(module_name)
File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/nose2/util.py", line 77, in module_from_name
__import__(name)
File "/home/runner/work/ipycache/ipycache/test_ipycache.py", line 19, in <module>
from nose.tools import raises, assert_raises
ModuleNotFoundError: No module named 'nose'
----------------------------------------------------------------------
Ran 1 test in 0.000s
FAILED (errors=1)
Error: Process completed with exit code 1.
Turns out, we don't need to migrate from nose
to nose2
because Python's standard library unittest
has all the functionality we need at this time, so we can reduce our set of dependencies by rewriting our tests to be in the Python unittest
style, and simplify our test setup, which should speed up our CI due to having fewer dependencies.
As described in this issue and our CI config,
nose
is deprecated and unmaintained, and incompatible with Python 3.10 and 3.11, and we need to upgrade tonose2
or another solution. We're choosingnose2
since it's closest tonose
, so unless there are critical issues withnose2
and this codebase, we should be fine with that approach for now.Closes https://github.com/rossant/ipycache/issues/61