diff test/test_dates.py @ 5036:380d8d8b30a3

Replace existing run_tests.py script with a pytest script The existing run_test.py script is quite old, a bit restrictive, and doesn't always behave as documented. The pytest testing tool is mature, well documented, and maintained. The run_tests.py script is generating by installing py.test and running: py.tests --genscript=run_tests.py Note: to generate a script that is compatible with python2.6 the command needs to be run using python2.6
author John Kristensen <john@jerrykan.com>
date Thu, 20 Aug 2015 18:15:23 +1000
parents 9cc6d463cfbe
children 364c54991861
line wrap: on
line diff
--- a/test/test_dates.py	Fri Aug 21 17:37:22 2015 +1000
+++ b/test/test_dates.py	Thu Aug 20 18:15:23 2015 +1000
@@ -20,10 +20,19 @@
 import datetime
 import calendar
 
+import pytest
 from roundup import date, i18n
 from roundup.date import Date, Interval, Range, fixTimeOverflow, \
     get_timezone
 
+try:
+    import pytz
+    SKIP_PYTZ = False
+except ImportError:
+    SKIP_PYTZ = True
+
+skip_pytz = pytest.mark.skipif(SKIP_PYTZ, reason="'pytz' not installed")
+
 
 class DateTestCase(unittest.TestCase):
     def setUp(self):
@@ -452,6 +461,8 @@
         ae (date.timestamp(), -61125753600.0)
         ae(str(date), '0033-01-01.00:00:00')
 
+
+@skip_pytz
 class TimezoneTestCase(unittest.TestCase):
 
     def testTZ(self):

Roundup Issue Tracker: http://roundup-tracker.org/