Skip to content

Commit 1bd667f

Browse files
committed
.travis.yml and python 3.5 fixes
1 parent abc05e0 commit 1bd667f

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ sudo: false
22

33
language: python
44
python:
5-
- "2.7"
65
- "3.2"
76
- "3.3"
87
- "3.4"
98
- "3.5"
109

1110
install:
1211
- pip install -e .
13-
- pip install coverage pep8 pyflakes
12+
- pip install coverage pep8 pyflakes mock
1413

1514
script:
1615
- pyflakes argsrun tests

tests/test_entry.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
import sys
12
import unittest
23
import argparse
3-
from unittest import mock
4+
try:
5+
from unittest import mock
6+
except ImportError:
7+
import mock
48

59
from argsrun import Entry
610

711

12+
PY_35 = sys.version_info >= (3, 5)
13+
14+
815
class 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):

0 commit comments

Comments
 (0)