Skip to content

Commit 5a146b5

Browse files
committed
switch from nose to pytest
1 parent 51fb66d commit 5a146b5

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
include_package_data=True,
5656
install_requires=install_reqs,
5757
dependency_links=dep_links,
58-
test_suite='tests',
5958
entry_points={
6059
'st2auth.backends.backend': [
6160
'keystone = st2auth_keystone_backend.keystone:KeystoneAuthenticationBackend',

test-requirements.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
flake8==7.0.0
22
mock==5.1.0
3-
nose>=1.3.7
43
pep8==1.7.1
54
pylint~=3.1.0
5+
pytest
66
st2flake8
7-
unittest2

tests/unit/test_keystone_backend.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
import sys
1717
import httplib
1818

19-
import unittest2
19+
import unittest
2020
import mock
2121
from requests.models import Response
2222

2323
from st2auth_keystone_backend.keystone import KeystoneAuthenticationBackend
2424

2525

26-
class KeystoneAuthenticationBackendTestCase(unittest2.TestCase):
26+
class KeystoneAuthenticationBackendTestCase(unittest.TestCase):
2727
def _mock_keystone(self, *args, **kwargs):
2828
return_codes = {
2929
'goodv2': httplib.OK,
@@ -70,4 +70,4 @@ def test_get_v3_creds(self):
7070
self.assertEqual('password', creds['auth']['identity']['password']['user']['password'])
7171

7272
if __name__ == '__main__':
73-
sys.exit(unittest2.main())
73+
sys.exit(unittest.main())

tox.ini

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
[tox]
2-
envlist = py27,lint
2+
envlist = py36,py38,py39,py310,py311,lint
33

44
[testenv]
55
deps = -r{toxinidir}/test-requirements.txt
6-
commands = python setup.py test
6+
commands = pytest
7+
8+
[testenv:py38]
9+
basepython = python3.8
10+
11+
[testenv:py39]
12+
basepython = python3.9
13+
14+
[testenv:py310]
15+
basepython = python3.10
16+
17+
[testenv:py311]
18+
basepython = python3.11
719

820
[testenv:lint]
9-
deps = -r{toxinidir}/test-requirements.txt
1021
commands = flake8 --config ./lint-configs/python/.flake8 st2auth_keystone_backend/
1122
pylint -E --rcfile=./lint-configs/python/.pylintrc st2auth_keystone_backend/

0 commit comments

Comments
 (0)