Commit d2db0ce8 authored by Jérome Perrin's avatar Jérome Perrin

core_test: adjust upstream DateTime tests

Drop old test adjustments, we only test DateTime >= 3 nowadays.

Make the condition for test_pickle_old_with_micros_as_float based on
python version for simplicity.
parent ee8d7fa8
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
import os import os
import unittest import unittest
import six
import zodbpickle.fastpickle as pickle import zodbpickle.fastpickle as pickle
from DateTime import DateTime from DateTime import DateTime
...@@ -340,27 +341,15 @@ def test_suite(): ...@@ -340,27 +341,15 @@ def test_suite():
class DateTimeTests(test_datetime.DateTimeTests): class DateTimeTests(test_datetime.DateTimeTests):
testTimezoneNaiveHandling = unittest.expectedFailure( testTimezoneNaiveHandling = unittest.expectedFailure(
test_datetime.DateTimeTests.testTimezoneNaiveHandling) test_datetime.DateTimeTests.testTimezoneNaiveHandling)
if six.PY3:
# ERP5 never used the pickle format with micros as float # ERP5 never used the pickle format with micros as float
# https://github.com/zopefoundation/DateTime/pull/62 # https://github.com/zopefoundation/DateTime/pull/62
test_pickle_old_with_micros_as_float = unittest.expectedFailure( test_pickle_old_with_micros_as_float = unittest.expectedFailure(
test_datetime.DateTimeTests.test_pickle_old_with_micros_as_float) test_datetime.DateTimeTests.test_pickle_old_with_micros_as_float)
# This test is only in DateTime >= 3
if hasattr(test_datetime.DateTimeTests, 'test_intl_format_hyphen'):
test_intl_format_hyphen = unittest.expectedFailure( test_intl_format_hyphen = unittest.expectedFailure(
test_datetime.DateTimeTests.test_intl_format_hyphen) test_datetime.DateTimeTests.test_intl_format_hyphen)
# These 3 tests are only in DateTime 2
if hasattr(test_datetime.DateTimeTests, 'test_pickle_new_with_micros'):
test_pickle_new_with_micros = unittest.expectedFailure(
test_datetime.DateTimeTests.test_pickle_new_with_micros)
if hasattr(test_datetime.DateTimeTests, 'test_pickle_new_with_tz'):
test_pickle_new_with_tz = unittest.expectedFailure(
test_datetime.DateTimeTests.test_pickle_new_with_tz)
if hasattr(test_datetime.DateTimeTests, 'testLegacyTimezones'):
testLegacyTimezones = unittest.expectedFailure(
test_datetime.DateTimeTests.testLegacyTimezones)
suite.addTest(unittest.makeSuite(DateTimeTests)) suite.addTest(unittest.makeSuite(DateTimeTests))
return suite return suite
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment