Skip to content

Commit f6ff888

Browse files
author
Aaron Gallagher
committed
Skip iso8601 example tests if there's no pytz.
1 parent 70a0d3e commit f6ff888

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

examples/test_iso8601.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
import datetime
22
import unittest
33

4-
import pytz
5-
6-
from iso8601 import DateTimeParser
4+
try:
5+
import pytz
6+
from iso8601 import DateTimeParser
7+
except ImportError:
8+
skip = 'pytz is not installed or usable'
9+
else:
10+
skip = None
711

812

913
class TestDatetimeParsing(unittest.TestCase):
14+
if skip is not None:
15+
skip = skip
1016

1117
def test_date(self):
1218
self.assertEqual(

0 commit comments

Comments
 (0)