From 0f2a41a33dbc4624f265dfdf62ef9ba68e8e9605 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Wed, 28 Jun 2017 18:34:56 -0700 Subject: Flake happiness --- setup.py | 6 +++--- src/isodate/isoduration.py | 1 + src/isodate/isotime.py | 6 +++--- src/isodate/tests/__init__.py | 1 + src/isodate/tests/test_date.py | 1 + src/isodate/tests/test_datetime.py | 1 + src/isodate/tests/test_duration.py | 1 + src/isodate/tests/test_pickle.py | 3 ++- src/isodate/tests/test_strf.py | 1 + src/isodate/tests/test_time.py | 1 + src/isodate/tzinfo.py | 2 ++ 11 files changed, 17 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 2778886..8069830 100644 --- a/setup.py +++ b/setup.py @@ -26,16 +26,16 @@ # CONTRACT, STRICT LIABILITY, OR TORT ############################################################################## import os -import sys +from setuptools import setup setupargs = {} - -from setuptools import setup setupargs['test_suite'] = 'isodate.tests.test_suite' + def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read() + setup(name='isodate', version='0.5.5.dev', packages=['isodate', 'isodate.tests'], diff --git a/src/isodate/isoduration.py b/src/isodate/isoduration.py index ab13acb..d64b3c0 100644 --- a/src/isodate/isoduration.py +++ b/src/isodate/isoduration.py @@ -55,6 +55,7 @@ ISO8601_PERIOD_REGEX = re.compile( if sys.version_info[0] >= 3: basestring = str + def parse_duration(datestring): """ Parses an ISO 8601 durations into datetime.timedelta or Duration objects. diff --git a/src/isodate/isotime.py b/src/isodate/isotime.py index c6d9391..a430982 100644 --- a/src/isodate/isotime.py +++ b/src/isodate/isotime.py @@ -36,13 +36,13 @@ import sys from decimal import Decimal from datetime import time -if sys.version_info > (3,): - long = int - from isodate.isostrf import strftime, TIME_EXT_COMPLETE, TZ_EXT from isodate.isoerror import ISO8601Error from isodate.isotzinfo import TZ_REGEX, build_tzinfo +if sys.version_info > (3,): + long = int + TIME_REGEX_CACHE = [] # used to cache regular expressions to parse ISO time strings. diff --git a/src/isodate/tests/__init__.py b/src/isodate/tests/__init__.py index 09dba2e..b1d46bd 100644 --- a/src/isodate/tests/__init__.py +++ b/src/isodate/tests/__init__.py @@ -46,5 +46,6 @@ def test_suite(): test_pickle.test_suite(), ]) + if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/src/isodate/tests/test_date.py b/src/isodate/tests/test_date.py index fdc1043..2fcc588 100644 --- a/src/isodate/tests/test_date.py +++ b/src/isodate/tests/test_date.py @@ -125,5 +125,6 @@ def test_suite(): def load_tests(loader, tests, pattern): return test_suite() + if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/src/isodate/tests/test_datetime.py b/src/isodate/tests/test_datetime.py index ddad5da..3cdfe42 100644 --- a/src/isodate/tests/test_datetime.py +++ b/src/isodate/tests/test_datetime.py @@ -142,5 +142,6 @@ def test_suite(): def load_tests(loader, tests, pattern): return test_suite() + if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/src/isodate/tests/test_duration.py b/src/isodate/tests/test_duration.py index 0b80a54..c03ae74 100644 --- a/src/isodate/tests/test_duration.py +++ b/src/isodate/tests/test_duration.py @@ -597,5 +597,6 @@ def test_suite(): def load_tests(loader, tests, pattern): return test_suite() + if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/src/isodate/tests/test_pickle.py b/src/isodate/tests/test_pickle.py index f4edda6..46bf34d 100644 --- a/src/isodate/tests/test_pickle.py +++ b/src/isodate/tests/test_pickle.py @@ -2,7 +2,7 @@ try: import cPickle as pickle except ImportError: import pickle -import unittest +import unittest import isodate @@ -53,5 +53,6 @@ def test_suite(): def load_tests(loader, tests, pattern): return test_suite() + if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/src/isodate/tests/test_strf.py b/src/isodate/tests/test_strf.py index 37a135b..1aa76c7 100644 --- a/src/isodate/tests/test_strf.py +++ b/src/isodate/tests/test_strf.py @@ -131,5 +131,6 @@ def test_suite(): def load_tests(loader, tests, pattern): return test_suite() + if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/src/isodate/tests/test_time.py b/src/isodate/tests/test_time.py index cc5ec08..7dfd0c0 100644 --- a/src/isodate/tests/test_time.py +++ b/src/isodate/tests/test_time.py @@ -139,5 +139,6 @@ def test_suite(): def load_tests(loader, tests, pattern): return test_suite() + if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/src/isodate/tzinfo.py b/src/isodate/tzinfo.py index b41f058..83b241c 100644 --- a/src/isodate/tzinfo.py +++ b/src/isodate/tzinfo.py @@ -36,6 +36,7 @@ class Utc(tzinfo): ''' return ZERO + UTC = Utc() # the default instance for UTC. @@ -138,5 +139,6 @@ class LocalTimezone(tzinfo): tt = time.localtime(stamp) return tt.tm_isdst > 0 + LOCAL = LocalTimezone() # the default instance for local time zone. -- cgit v1.2.1