summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Socol <me@jamessocol.com>2022-11-05 17:21:32 -0400
committerJames Socol <me@jamessocol.com>2022-11-05 17:21:32 -0400
commitb00f0db002fc85e3702da9427ac13ba0df2f124a (patch)
treea4c82354477a40b2d49f96fdc80a6d500c5579e7
parent0bd1a158849f7307f1ee3be0e9c0addecf74520b (diff)
downloadpystatsd-b00f0db002fc85e3702da9427ac13ba0df2f124a.tar.gz
Replace nose with nose2
Nose stopped getting updates around 2015. Nose2 is is the continued evolution of that project. Ultimately, this library's test suite is simple enough to move toward pure unittest, but that will require a larger refactor to wrap everything in unittest.TestCase.
-rw-r--r--docs/contributing.rst6
-rw-r--r--requirements.txt6
-rw-r--r--setup.py1
-rw-r--r--statsd/tests.py9
-rw-r--r--tox.ini5
5 files changed, 13 insertions, 14 deletions
diff --git a/docs/contributing.rst b/docs/contributing.rst
index 63639a5..c16769b 100644
--- a/docs/contributing.rst
+++ b/docs/contributing.rst
@@ -25,12 +25,12 @@ necessary.
Running Tests
=============
-To run the tests, you just need ``nose`` and ``mock``. These can be
-installed with ``pip``::
+To run the tests, you just need ``nose2``. This can be installed with
+``pip``::
$ mkvirtualenv statsd
$ pip install -r requirements.txt
- $ nosetests
+ $ nose2
You can also run the tests with tox::
diff --git a/requirements.txt b/requirements.txt
index 6aa9af6..f81678b 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
-mock==1.0.1
-nose==1.2.1
-flake8==1.7.0
+nose2
+flake8
+coverage
diff --git a/setup.py b/setup.py
index 197757f..db88931 100644
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,6 @@ setup(
packages=find_packages(),
include_package_data=True,
package_data={'': ['README.rst']},
- test_suite='nose.collector',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
diff --git a/statsd/tests.py b/statsd/tests.py
index 12fc410..49fc2f0 100644
--- a/statsd/tests.py
+++ b/statsd/tests.py
@@ -4,10 +4,7 @@ import random
import re
import socket
from datetime import timedelta
-from unittest import SkipTest
-
-import mock
-from nose.tools import eq_
+from unittest import SkipTest, mock
from statsd import StatsClient
from statsd import TCPStatsClient
@@ -34,6 +31,10 @@ make_val = {
}
+def eq_(a, b, msg=None):
+ assert a == b, msg
+
+
def _udp_client(prefix=None, addr=None, port=None, ipv6=False):
if not addr:
addr = ADDR[0]
diff --git a/tox.ini b/tox.ini
index 32136cf..06d6d59 100644
--- a/tox.ini
+++ b/tox.ini
@@ -3,9 +3,8 @@ envlist = py37,py38,py39,py310,py311,pypy3
[testenv]
deps=
- mock
- nose
+ nose2
coverage
commands=
- nosetests statsd --with-coverage --cover-package=statsd []
+ nose2 statsd --with-coverage