Skip to content

Commit

Permalink
Make tests runnable with pytest.
Browse files Browse the repository at this point in the history
Also update travisci to use pytest.
  • Loading branch information
jd-boyd committed Oct 30, 2018
1 parent a5b40c4 commit ec97124
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ install:
script:
- echo -e 'x=0\nfor i in range(0, 10000000):\n x+=i\nprint(x)' > fake.py
- howlong -i 1 -c python fake.py
- pytest

after_success:
- bash <(curl -s https://codecov.io/bash)
9 changes: 2 additions & 7 deletions HowLong/test_parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import unittest
from HowLong import HowLong

from HowLong.HowLong import HowLong

class TestParser(unittest.TestCase):

Expand All @@ -13,7 +12,7 @@ def test_empty_arguments(self):
'''Tests with no arguments
At least one argument is required.
'''
with self.assertRaises(AssertionError):
with self.assertRaises(SystemExit):
self.parser()

def test_c_option_with_empty_arguments(self):
Expand All @@ -29,7 +28,3 @@ def test_p_option_with_empty_arguments(self):
'''
with self.assertRaises(TypeError):
self.parser('-p')


if __name__ == "__main__":
unittest.main()
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
psutil>=5.0.1
termcolor>=1.1.0
colorama>=0.3.9
pytest==3.9.2
pytest-cov==2.6.0
six==1.11.0
-e .

0 comments on commit ec97124

Please sign in to comment.