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
I think pytest does not provide similar functions (or does it?). However, it should be trivial to implement our own variants for these, or just rewrite all code usages by directly using assert.
(Pytest cleverly handles normal assert and somehow figures out for sth like assert a == b that this is checking equality, and then also prints a and b. I'm not sure if those heuristics/tricks/hacks always work correctly, although they seem to. But maybe to have that explicit as assert_equal is better also when we want to switch at some later point to some other testing framework? Not sure...)
Nose is deprecated and I think only works with Python <=3.9, not later. So we definitely must remove this dependency for our tests.
The error you see when you run this on a newer Python version:
test_Util.py:4: in <module>
from nose.tools import assert_equal, assert_not_equal, assert_raises, assert_true, assert_is
/work/az668407/py-envs/py3.12-torch2.5/lib64/python3.12/site-packages/nose/__init__.py:1: in <module>
from nose.core import collector, main, run, run_exit, runmodule
/work/az668407/py-envs/py3.12-torch2.5/lib64/python3.12/site-packages/nose/core.py:12: in <module>
from nose.loader import defaultTestLoader
/work/az668407/py-envs/py3.12-torch2.5/lib64/python3.12/site-packages/nose/loader.py:21: in <module>
from nose.importer import Importer, add_path, remove_path
/work/az668407/py-envs/py3.12-torch2.5/lib64/python3.12/site-packages/nose/importer.py:12: in <module>
from imp import find_module, load_module, acquire_lock, release_lock
E ModuleNotFoundError: No module named 'imp'
The text was updated successfully, but these errors were encountered:
We used to use nose for our tests. We now switched to pytest. However, in some of the tests, we still make use of some nose utility functions like:
I think pytest does not provide similar functions (or does it?). However, it should be trivial to implement our own variants for these, or just rewrite all code usages by directly using
assert
.(Pytest cleverly handles normal
assert
and somehow figures out for sth likeassert a == b
that this is checking equality, and then also printsa
andb
. I'm not sure if those heuristics/tricks/hacks always work correctly, although they seem to. But maybe to have that explicit asassert_equal
is better also when we want to switch at some later point to some other testing framework? Not sure...)Nose is deprecated and I think only works with Python <=3.9, not later. So we definitely must remove this dependency for our tests.
The error you see when you run this on a newer Python version:
The text was updated successfully, but these errors were encountered: