File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,15 +2,14 @@ sudo: false
22
33language : python
44python :
5- - " 2.7"
65- " 3.2"
76- " 3.3"
87- " 3.4"
98- " 3.5"
109
1110install :
1211- pip install -e .
13- - pip install coverage pep8 pyflakes
12+ - pip install coverage pep8 pyflakes mock
1413
1514script :
1615- pyflakes argsrun tests
Original file line number Diff line number Diff line change 1+ import sys
12import unittest
23import argparse
3- from unittest import mock
4+ try :
5+ from unittest import mock
6+ except ImportError :
7+ import mock
48
59from argsrun import Entry
610
711
12+ PY_35 = sys .version_info >= (3 , 5 )
13+
14+
815class TestEntry (unittest .TestCase ):
916
1017 def dummy_handler (self , opts ):
@@ -31,8 +38,11 @@ def test_simple(self):
3138
3239 entry (['script' ])
3340
34- with self .assertRaisesRegex (ValueError ,
35- "need more than 0 values to unpack" ):
41+ if PY_35 :
42+ msg = "not enough values to unpack"
43+ else :
44+ msg = "need more than 0 values to unpack"
45+ with self .assertRaisesRegex (ValueError , msg ):
3646 entry ([])
3747
3848 def test_argparse_setup (self ):
You can’t perform that action at this time.
0 commit comments