Skip to content

Commit e91e5ac

Browse files
authored
Merge pull request #54 from robotadam/fix-unittests
Swap unittest2 for stdlib unittest so test work on modern python versions
2 parents 0e1eeee + f7914ac commit e91e5ac

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

dwollav2/test/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import os
2-
import unittest2
2+
import unittest
33

44

55
def all():
66
path = os.path.dirname(os.path.realpath(__file__))
7-
return unittest2.defaultTestLoader.discover(path)
7+
return unittest.defaultTestLoader.discover(path)
88

99

1010
def resources():
1111
path = os.path.dirname(os.path.realpath(__file__))
12-
return unittest2.defaultTestLoader.discover(
12+
return unittest.defaultTestLoader.discover(
1313
os.path.join(path, "resources"))

dwollav2/test/test_auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import unittest2
1+
import unittest
22
import responses
33
from mock import Mock
44
try:
@@ -9,7 +9,7 @@
99
import dwollav2
1010

1111

12-
class AuthShould(unittest2.TestCase):
12+
class AuthShould(unittest.TestCase):
1313
client = dwollav2.Client(id='id', secret='secret', on_grant=Mock())
1414
redirect_uri = 'redirect uri'
1515
scope = 'scope'

dwollav2/test/test_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import unittest2
1+
import unittest
22
import responses
33

44
import dwollav2
55

66

7-
class ClientShould(unittest2.TestCase):
7+
class ClientShould(unittest.TestCase):
88
id = 'client-id'
99
secret = 'client-secret'
1010

dwollav2/test/test_error.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import unittest2
1+
import unittest
22
import requests
33

44
import dwollav2
55

66

7-
class ErrorShould(unittest2.TestCase):
7+
class ErrorShould(unittest.TestCase):
88
def test_maps_string_to_generic_error(self):
99
error = 'foo'
1010
with self.assertRaises(dwollav2.Error) as ecm:

dwollav2/test/test_response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import unittest2
1+
import unittest
22
import requests
33

44
import dwollav2
55

66

7-
class ResponseShould(unittest2.TestCase):
7+
class ResponseShould(unittest.TestCase):
88
def test_raises_error_if_over_400(self):
99
res = requests.Response()
1010
res.status_code = 400

dwollav2/test/test_token.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import unittest2
1+
import unittest
22
import responses
33

44
import dwollav2
55

66

7-
class TokenShould(unittest2.TestCase):
7+
class TokenShould(unittest.TestCase):
88
client = dwollav2.Client(id='id', secret='secret')
99
access_token = 'access token'
1010
refresh_token = 'refresh token'

0 commit comments

Comments
 (0)