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.

Remove travis testing for python 3.2 and 3.3 since PyTest no longer
supports those versions.
  • Loading branch information
jd-boyd committed Oct 30, 2018
1 parent a5b40c4 commit 0959e39
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
language: python
python:
- 2.7
- 3.2
- 3.3
- 3.4
- 3.5
- 3.6
Expand All @@ -14,6 +12,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)
11 changes: 4 additions & 7 deletions HowLong/test_parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import unittest
from HowLong import HowLong
from __future__ import absolute_import

import unittest
from HowLong.HowLong import HowLong

class TestParser(unittest.TestCase):

Expand All @@ -13,7 +14,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 +30,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 0959e39

Please sign in to comment.