Skip to content

Commit c5bd0bb

Browse files
committed
test: switch to pytest
Signed-off-by: Adrien Barreau <adrien.barreau@ovhcloud.com>
1 parent f803b19 commit c5bd0bb

File tree

4 files changed

+10
-19
lines changed

4 files changed

+10
-19
lines changed

setup.cfg

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,11 @@ exclude =
4040
[options.extras_require]
4141
dev =
4242
coverage==5.5
43-
mock==1.0.1
44-
# nose >= 1.3.4 is not compatible with Python 3.10 due to collections.Callable
45-
nose==1.3.3
46-
yanc==0.2.4
4743
Sphinx==1.2.2
4844
coveralls==3.2.0
4945
setuptools>=30.3.0
5046
wheel
51-
test =
52-
coverage==5.5
53-
mock==1.0.1
54-
# nose >= 1.3.4 is not compatible with Python 3.10 due to collections.Callable
55-
nose==1.3.3
56-
yanc==0.2.4
47+
pytest
5748

5849
[test]
5950
test-suite = nose.collector

tests/test_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828

2929
import unittest
30-
import mock
30+
from unittest import mock
3131
import json
3232
from collections import OrderedDict
3333

@@ -48,7 +48,7 @@
4848
'OVH_CONSUMER_KEY': 'consumer key from from environ',
4949
}
5050

51-
M_CUSTOM_CONFIG_PATH = './fixtures/custom_ovh.conf'
51+
M_CUSTOM_CONFIG_PATH = 'tests/fixtures/custom_ovh.conf'
5252

5353
APPLICATION_KEY = 'fake application key'
5454
APPLICATION_SECRET = 'fake application secret'

tests/test_config.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828

2929
from ovh import config
3030
import unittest
31-
import mock
31+
from unittest import mock
3232
import os
3333

3434
M_CONFIG_PATH = [
35-
'./fixtures/etc_ovh.conf',
36-
'./fixtures/home_ovh.conf',
37-
'./fixtures/pwd_ovh.conf',
35+
'tests/fixtures/etc_ovh.conf',
36+
'tests/fixtures/home_ovh.conf',
37+
'tests/fixtures/pwd_ovh.conf',
3838
]
3939

40-
M_CUSTOM_CONFIG_PATH = './fixtures/custom_ovh.conf'
40+
M_CUSTOM_CONFIG_PATH = 'tests/fixtures/custom_ovh.conf'
4141

4242
M_ENVIRON = {
4343
'OVH_ENDPOINT': 'endpoint from environ',
@@ -63,7 +63,7 @@ def test_real_lookup_path(self):
6363
self.assertEqual([
6464
'/etc/ovh.conf',
6565
home+'/.ovh.conf',
66-
pwd+'/tests/ovh.conf',
66+
pwd+'/ovh.conf',
6767

6868
], self._orig_CONFIG_PATH)
6969

tests/test_consumer_key.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828

2929
import unittest
30-
import mock
30+
from unittest import mock
3131

3232
class testConsumerKeyRequest(unittest.TestCase):
3333
def test_add_rules(self):

0 commit comments

Comments
 (0)