diff --git a/.gitignore b/.gitignore --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,4 @@ version.txt build/ dist/ -.tox +.tox/ diff --git a/requirements-test.txt b/requirements-test.txt --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1 +1 @@ -nose +pytest diff --git a/swh/loader/pypi/tests/test_client.py b/swh/loader/pypi/tests/test_client.py --- a/swh/loader/pypi/tests/test_client.py +++ b/swh/loader/pypi/tests/test_client.py @@ -55,7 +55,7 @@ for pkginfo, author, release, artifact, dir_path in actual_releases: version = pkginfo['version'] expected_pkginfo = _project_pkginfo(dir_path) - self.assertEquals(pkginfo, expected_pkginfo) + self.assertEqual(pkginfo, expected_pkginfo) expected_author = converters.author(expected_pkginfo) self.assertEqual(author, expected_author) expected_artifact = expected_release_artifacts[version] diff --git a/swh/loader/pypi/tests/test_converters.py b/swh/loader/pypi/tests/test_converters.py --- a/swh/loader/pypi/tests/test_converters.py +++ b/swh/loader/pypi/tests/test_converters.py @@ -70,7 +70,7 @@ 'email': b'iam@groot.org', } - self.assertEquals(actual_author, expected_author) + self.assertEqual(actual_author, expected_author) def test_author_malformed(self): data = { @@ -86,7 +86,7 @@ 'email': None, } - self.assertEquals(actual_author, expected_author) + self.assertEqual(actual_author, expected_author) def test_author_malformed_2(self): data = { @@ -102,7 +102,7 @@ 'email': b'[marie@some, jeanne@thing]', } - self.assertEquals(actual_author, expected_author) + self.assertEqual(actual_author, expected_author) def test_author_malformed_3(self): data = { @@ -118,4 +118,4 @@ 'email': b'[marie@somewhere.org, jeanne@somewhere.org]', } - self.assertEquals(actual_author, expected_author) + self.assertEqual(actual_author, expected_author) diff --git a/swh/loader/pypi/tests/test_loader.py b/swh/loader/pypi/tests/test_loader.py --- a/swh/loader/pypi/tests/test_loader.py +++ b/swh/loader/pypi/tests/test_loader.py @@ -4,7 +4,6 @@ # See top-level LICENSE file for more information import json -import shutil import tempfile from nose.plugins.attrib import attr @@ -239,7 +238,7 @@ self.assertSnapshotOk(expected_snapshot_id, expected_branches) _id = hashutil.hash_to_hex(self.loader._last_snapshot()['id']) - self.assertEquals(expected_snapshot_id, _id) + self.assertEqual(expected_snapshot_id, _id) self.assertEqual(self.loader.load_status(), {'status': 'uneventful'}) self.assertEqual(self.loader.visit_status(), 'full') diff --git a/tox.ini b/tox.ini new file mode 100644 --- /dev/null +++ b/tox.ini @@ -0,0 +1,16 @@ +[tox] +envlist=flake8,py3 + +[testenv:py3] +deps = + .[testing] + pytest-cov +commands = + pytest --cov=swh --cov-branch {posargs} + +[testenv:flake8] +skip_install = true +deps = + flake8 +commands = + {envpython} -m flake8