ukoethe / vigra

a generic C++ library for image analysis
http://ukoethe.github.io/vigra/
Other
406 stars 191 forks source link

Migrate to pytest #545

Closed hmaarrfk closed 9 months ago

hmaarrfk commented 9 months ago

Closes https://github.com/ukoethe/vigra/issues/508

eli-schwartz commented 7 months ago

Hi, it looks like this is still installing nose in CI, and a bunch of files import functions from nose.tools. Unfortunately simply switching the test runner entrypoint is not enough to actually stop using nose, so I'm not sure how much this helps at the moment. It would be great to get the final bits and pieces cleaned up too.

hmaarrfk commented 7 months ago

sorry you are correct. PRs welcome to address these deficiencies.

hmaarrfk commented 7 months ago

a pr like the following:

diff --git a/vigranumpy/test/test_color.py b/vigranumpy/test/test_color.py
index 5551a976..fd83182b 100644
--- a/vigranumpy/test/test_color.py
+++ b/vigranumpy/test/test_color.py
@@ -38,10 +38,12 @@ import sys
 print("\nexecuting test file", __file__, file=sys.stderr)
 exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec'))

-from nose.tools import assert_equal, raises, assert_raises, assert_true
 import vigra
 import numpy

+def assert_true(x):
+    assert x
+
 _have_qt = False
 try:
     from PyQt4.QtGui import QImage
diff --git a/vigranumpy/test/test_multidef.py b/vigranumpy/test/test_multidef.py
index a993a22c..7dbe9558 100644
--- a/vigranumpy/test/test_multidef.py
+++ b/vigranumpy/test/test_multidef.py
@@ -38,7 +38,8 @@ import sys
 print("\nexecuting test file", __file__, file=sys.stderr)
 exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec'))

-from nose.tools import assert_equal, raises, assert_raises
+# Left over from using nose which has been deprecated
+from unittest import assertRaises as assert_raises
 import vigra
 import numpy as np

would be really appreciated.