From d8df74d5512ad4d563ba6301c970888eb0e90630 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl>
Date: Sun, 19 Jan 2020 16:47:04 +0100
Subject: [PATCH] switch to nose2 for tests

---
 .travis.yml      | 2 +-
 CHANGELOG.md     | 1 +
 Vagrantfile      | 2 +-
 setup.cfg        | 5 -----
 setup.py         | 4 ++--
 tests/Dockerfile | 2 +-
 unittest.cfg     | 2 ++
 7 files changed, 8 insertions(+), 10 deletions(-)
 create mode 100644 unittest.cfg

diff --git a/.travis.yml b/.travis.yml
index d9c1719..a97d33b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,7 +10,7 @@ python:
  - "pypy3.5"
 script:
  - python -m compile_definitions
- - python setup.py nosetests --tests tests
+ - nose2 tests
  - python -m stress_tests
 install:
  - pip install -r requirements.txt
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 628273b..eeb1c53 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
 
 * more extensive testing (CPython3.8, nightly)
 * fixed a bug wherein future_to_notify_on_dead was set_result multiple times
+* switched to nose2 for tests
 
 # v0.103:
 
diff --git a/Vagrantfile b/Vagrantfile
index 80e0876..0e7b13d 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -30,7 +30,7 @@ Vagrant.configure("2") do |config|
     sudo python -m pip install -r /vagrant/requirements.txt
     sudo python -m pip install nose coverage mock yapf
     sudo pip3 install -r /vagrant/requirements.txt
-    sudo pip3 install nose coverage mock yapf
+    sudo pip3 install nose2[coverage_plugin] coverage mock yapf nose2
     
     sudo pip3 install -r /vagrant/stress_tests/requirements.txt
     
diff --git a/setup.cfg b/setup.cfg
index 34988c5..7a8ef6b 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -29,11 +29,6 @@ max-line-length=80
 [bdist_wheel]
 universal=1
 
-[nosetests]
-verbosity=3
-detailed-errors=1
-with-coverage=1
-
 [isort]
 add_imports =
     from __future__ import absolute_import
diff --git a/setup.py b/setup.py
index a9b0eee..3a2d024 100644
--- a/setup.py
+++ b/setup.py
@@ -12,8 +12,8 @@ setup(keywords=['amqp', 'rabbitmq', 'client', 'network', 'ha', 'high availabilit
 Also, handles your reconnects and transactionality THE RIGHT WAY, though somewhat opinionated''',
       install_requires=['six', 'monotonic', 'futures', 'typing'],
       # per coverage version for codeclimate-reporter
-      tests_require=["nose", 'coverage>=4.0,<4.4'],
-      test_suite='nose.collector'
+      tests_require=["nose2", 'coverage>=4.0,<4.4', "nose2[coverage_plugin]"],
+      test_suite='nose2.collector.collector'
       )
 
 
diff --git a/tests/Dockerfile b/tests/Dockerfile
index 903742f..d202d37 100644
--- a/tests/Dockerfile
+++ b/tests/Dockerfile
@@ -6,7 +6,7 @@ ADD requirements.txt /tmp/requirements.txt
 ADD stress_tests/requirements.txt /tmp/requirements2.txt
 RUN pip install -r /tmp/requirements.txt && \
     pip install -r /tmp/requirements2.txt && \
-    pip install nose mock coverage
+    pip install nose2 mock coverage nose2[coverage_plugin]
 
 ADD . /coolamqp
 WORKDIR /coolamqp
diff --git a/unittest.cfg b/unittest.cfg
new file mode 100644
index 0000000..84743c4
--- /dev/null
+++ b/unittest.cfg
@@ -0,0 +1,2 @@
+[coverage]
+always-on = True
-- 
GitLab