test_win32timezone.py 741 B

1234567891011121314151617181920212223
  1. # Test module for win32timezone
  2. import sys
  3. import unittest
  4. import win32timezone
  5. import doctest
  6. class Win32TimeZoneTest(unittest.TestCase):
  7. def testWin32TZ(self):
  8. # On 3.7 and later, the repr() for datetime objects changed to use kwargs - eg,
  9. # eg, `datetime.timedelta(0, 10800)` is now `datetime.timedelta(seconds=10800)`.
  10. # So we just skip the tests on 3.5 and 3.6
  11. if sys.version_info < (3,7):
  12. from pywin32_testutil import TestSkipped
  13. raise TestSkipped("The repr() for datetime objects makes this test fail in 3.5 and 3.6")
  14. failed, total = doctest.testmod(win32timezone, verbose=False)
  15. self.assertFalse(failed)
  16. if __name__ == '__main__':
  17. unittest.main()