Skip to content

Commit 57e5ecd

Browse files
committed
Re-organized tests to enable pytest to discover the full suite
1 parent 10ec1a1 commit 57e5ecd

5 files changed

Lines changed: 10 additions & 7 deletions

File tree

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ redirect_url = client.create_redirect_url('http://google.com/', 'user_id', event
131131
First, make sure you can run the test suite. Tests are run via py.test
132132

133133
```bash
134-
py.test stream/tests.py
134+
py.test
135135
# with coverage
136-
py.test stream/tests.py --cov stream --cov-report html
136+
py.test --cov stream --cov-report html
137137
# against a local API backend
138-
LOCAL=true py.test stream/tests.py
138+
LOCAL=true py.test
139139
```
140140

141141
### Copyright and License Information

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def run_tests(self):
4949
# import here, cause outside the eggs aren't loaded
5050
import pytest
5151
errno = pytest.main(
52-
'stream/tests.py --cov stream --cov-report term-missing -v')
52+
'--cov stream --cov-report term-missing -v')
5353
sys.exit(errno)
5454

5555
setup(

‎stream/httpsig/tests/test_signature.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@
1010
from stream.httpsig.utils import parse_authorization_header
1111

1212

13-
sign.DEFAULT_SIGN_ALGORITHM = "rsa-sha256"
14-
15-
1613
class TestSign(unittest.TestCase):
14+
DEFAULT_SIGN_ALGORITHM = sign.DEFAULT_SIGN_ALGORITHM
1715

1816
def setUp(self):
17+
sign.DEFAULT_SIGN_ALGORITHM = "rsa-sha256"
1918
self.key_path = os.path.join(os.path.dirname(__file__), 'rsa_private.pem')
2019
with open(self.key_path, 'rb') as f:
2120
self.key = f.read()
2221

22+
def tearDown(self):
23+
sign.DEFAULT_SIGN_ALGORITHM = self.DEFAULT_SIGN_ALGORITHM
24+
2325
def test_default(self):
2426
hs = sign.HeaderSigner(key_id='Test', secret=self.key)
2527
unsigned = {

‎stream/tests/__init__.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .test_client import *

0 commit comments

Comments
 (0)