From 114da2a6cad700654ef2c0ebf56f3f3a403c67f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Wed, 20 Jan 2021 16:36:41 +0100 Subject: [PATCH] get rid of nose --- README.rst | 2 +- appveyor.yml | 3 ++- setup.cfg | 4 ---- setup.py | 1 - test/accuracy_test.py | 1 - test/hamming_index_test.py | 4 ++-- tox.ini | 2 +- 7 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 setup.cfg diff --git a/README.rst b/README.rst index 7468f9b2..fd793e6d 100644 --- a/README.rst +++ b/README.rst @@ -152,7 +152,7 @@ It's all written in C++ with a handful of ugly optimizations for performance and The code should support Windows, thanks to `Qiang Kou `__ and `Timothy Riley `__. -To run the tests, execute `python setup.py nosetests`. The test suite includes a big real world dataset that is downloaded from the internet, so it will take a few minutes to execute. +To run the tests, execute `python -m unittest`. The test suite includes a big real world dataset that is downloaded from the internet, so it will take a few minutes to execute. Discuss ------- diff --git a/appveyor.yml b/appveyor.yml index cb0c2a15..73125ae5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,4 +18,5 @@ build_script: - "python setup.py build" test_script: - - "python setup.py nosetests" + - "PYTHONPATH=." + - "python -m unittest -v" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 8bbe8b72..00000000 --- a/setup.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[nosetests] -attr=!slow -nocapture=1 - diff --git a/setup.py b/setup.py index f29e9f29..5c5213e2 100644 --- a/setup.py +++ b/setup.py @@ -100,6 +100,5 @@ 'Programming Language :: Python :: 3.6', ], keywords='nns, approximate nearest neighbor search', - setup_requires=['nose>=1.0'], tests_require=['numpy', 'h5py'] ) diff --git a/test/accuracy_test.py b/test/accuracy_test.py index 441e5c28..7ecf0506 100644 --- a/test/accuracy_test.py +++ b/test/accuracy_test.py @@ -24,7 +24,6 @@ except ImportError: from urllib.request import urlretrieve # Python 3 import gzip -from nose.plugins.attrib import attr class AccuracyTest(unittest.TestCase): def _get_index(self, dataset): diff --git a/test/hamming_index_test.py b/test/hamming_index_test.py index 74de10a9..fade8a5a 100644 --- a/test/hamming_index_test.py +++ b/test/hamming_index_test.py @@ -12,11 +12,11 @@ # License for the specific language governing permissions and limitations under # the License. +import unittest import numpy import random from common import TestCase from annoy import AnnoyIndex -from nose.plugins.skip import SkipTest class HammingIndexTest(TestCase): @@ -85,7 +85,7 @@ def test_many_vectors(self): avg_dist = 1.0 * sum(dists) / len(dists) self.assertLessEqual(avg_dist, 0.42) - @SkipTest # will fix later + @unittest.skip('will fix later') def test_zero_vectors(self): # Mentioned on the annoy-user list bitstrings = [ diff --git a/tox.ini b/tox.ini index 5a2e5cae..00d229a0 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ setenv = commands = pip install numpy h5py pip install . - python setup.py nosetests --verbosity=3 + python -m unittest -v [testenv:go] setenv =