Skip to content

Commit 31d2ee4

Browse files
remove nose, use pytest
1 parent 8c0c4dd commit 31d2ee4

File tree

4 files changed

+16
-21
lines changed

4 files changed

+16
-21
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ test: test_unit
55

66
test_unit:
77
mkdir -p build
8-
nosetests --with-coverage tests/unit
8+
coverage run -m pytest tests/unit
9+
coverage xml

requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ pep8==1.5.7
2222
# nose makes testing easier
2323
# License: GNU Library or Lesser General Public License (LGPL)
2424
# Upstream url: http://readthedocs.org/docs/nose
25-
nose==1.3.7
25+
# nose==1.3.7
2626

27-
# Mocking and Patching Library for Testing
28-
# License: BSD
29-
# Upstream url: http://www.voidspace.org.uk/python/mock
30-
mock==1.0.1
27+
# Testing library
28+
# License: MIT
29+
# Upstream url: https://github.com/pytest-dev/pytest
30+
pytest==6.2.5

setup.cfg

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
# Project specific configuration used by the following tools:
2-
# - nosetests
2+
# - pytest
33
# - flake8
4-
#
5-
# nosetests only support setup.cfg. flake8 supports both setup.cfg and tox.ini. In
6-
# In order to not have too many files around, we'll use setup.cfg for now.
74

8-
[nosetests]
9-
# Turn this back on if the logs to too spammy.
10-
#nocapture=1
11-
with-xunit = 1
12-
xunit-file = build/nosetests.xml
13-
cover-package = kmsauth
14-
cover-xml = 1
15-
cover-xml-file = build/coverage.xml
16-
cover-min-percentage = 70
5+
6+
[coverage:report]
7+
fail_under = 40
8+
9+
[coverage:xml]
10+
output = build/coverage.xml
1711

1812
[flake8]
1913
# The jenkins violations plugin can read the pylint format.

tests/unit/kmsauth/kmsauth_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import json
44

55
import unittest
6-
from mock import patch
7-
from mock import MagicMock
6+
from unittest.mock import patch
7+
from unittest.mock import MagicMock
88

99
import kmsauth
1010
from kmsauth.utils import lru

0 commit comments

Comments
 (0)