55import unittest
66import zoneinfo
77
8- from test .support .hypothesis_helper import hypothesis , mark_hypothesis
8+ from test .support import mark_module
9+ from test .support .hypothesis_helper import hypothesis
910
1011import test .test_zoneinfo ._support as test_support
1112
13+ mark_module ('hypothesis' )
14+
1215ZoneInfoTestBase = test_support .ZoneInfoTestBase
1316
1417py_zoneinfo , c_zoneinfo = test_support .get_modules ()
@@ -96,14 +99,12 @@ class ZoneInfoTest(ZoneInfoTestBase):
9699
97100 @hypothesis .given (key = valid_keys ())
98101 @add_key_examples
99- @mark_hypothesis
100102 def test_str (self , key ):
101103 zi = self .klass (key )
102104 self .assertEqual (str (zi ), key )
103105
104106 @hypothesis .given (key = valid_keys ())
105107 @add_key_examples
106- @mark_hypothesis
107108 def test_key (self , key ):
108109 zi = self .klass (key )
109110
@@ -121,7 +122,6 @@ def test_key(self, key):
121122 @hypothesis .example (dt = datetime .time (0 ))
122123 @hypothesis .example (dt = datetime .time (12 , 0 ))
123124 @hypothesis .example (dt = datetime .time (23 , 59 , 59 , 999999 ))
124- @mark_hypothesis
125125 def test_utc (self , dt ):
126126 zi = self .klass ("UTC" )
127127 dt_zi = dt .replace (tzinfo = zi )
@@ -147,7 +147,6 @@ def setUp(self):
147147
148148 @hypothesis .given (key = valid_keys ())
149149 @add_key_examples
150- @mark_hypothesis
151150 def test_pickle_unpickle_cache (self , key ):
152151 zi = self .klass (key )
153152 for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
@@ -158,7 +157,6 @@ def test_pickle_unpickle_cache(self, key):
158157
159158 @hypothesis .given (key = valid_keys ())
160159 @add_key_examples
161- @mark_hypothesis
162160 def test_pickle_unpickle_no_cache (self , key ):
163161 zi = self .klass .no_cache (key )
164162 for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
@@ -170,7 +168,6 @@ def test_pickle_unpickle_no_cache(self, key):
170168
171169 @hypothesis .given (key = valid_keys ())
172170 @add_key_examples
173- @mark_hypothesis
174171 def test_pickle_unpickle_cache_multiple_rounds (self , key ):
175172 """Test that pickle/unpickle is idempotent."""
176173 zi_0 = self .klass (key )
@@ -189,7 +186,6 @@ def test_pickle_unpickle_cache_multiple_rounds(self, key):
189186
190187 @hypothesis .given (key = valid_keys ())
191188 @add_key_examples
192- @mark_hypothesis
193189 def test_pickle_unpickle_no_cache_multiple_rounds (self , key ):
194190 """Test that pickle/unpickle is idempotent."""
195191 zi_cache = self .klass (key )
@@ -222,7 +218,6 @@ class ZoneInfoCacheTest(ZoneInfoTestBase):
222218
223219 @hypothesis .given (key = valid_keys ())
224220 @add_key_examples
225- @mark_hypothesis
226221 def test_cache (self , key ):
227222 zi_0 = self .klass (key )
228223 zi_1 = self .klass (key )
@@ -231,7 +226,6 @@ def test_cache(self, key):
231226
232227 @hypothesis .given (key = valid_keys ())
233228 @add_key_examples
234- @mark_hypothesis
235229 def test_no_cache (self , key ):
236230 zi_0 = self .klass .no_cache (key )
237231 zi_1 = self .klass .no_cache (key )
@@ -255,7 +249,6 @@ def _is_ambiguous(self, dt):
255249 @hypothesis .example (dt = datetime .datetime (1970 , 1 , 1 ), key = "America/New_York" )
256250 @hypothesis .example (dt = datetime .datetime (2020 , 1 , 1 ), key = "Europe/Paris" )
257251 @hypothesis .example (dt = datetime .datetime (2020 , 6 , 1 ), key = "Europe/Paris" )
258- @mark_hypothesis
259252 def test_same_str (self , dt , key ):
260253 py_dt = dt .replace (tzinfo = py_zoneinfo .ZoneInfo (key ))
261254 c_dt = dt .replace (tzinfo = c_zoneinfo .ZoneInfo (key ))
@@ -271,7 +264,6 @@ def test_same_str(self, dt, key):
271264 @hypothesis .example (dt = datetime .datetime (2040 , 1 , 1 ), key = "Europe/Paris" )
272265 @hypothesis .example (dt = datetime .datetime .min , key = "Asia/Tokyo" )
273266 @hypothesis .example (dt = datetime .datetime .max , key = "Asia/Tokyo" )
274- @mark_hypothesis
275267 def test_same_offsets_and_names (self , dt , key ):
276268 py_dt = dt .replace (tzinfo = py_zoneinfo .ZoneInfo (key ))
277269 c_dt = dt .replace (tzinfo = c_zoneinfo .ZoneInfo (key ))
@@ -292,7 +284,6 @@ def test_same_offsets_and_names(self, dt, key):
292284 dt = datetime .datetime (2006 , 10 , 29 , 5 , 15 , tzinfo = UTC ),
293285 key = "America/New_York" ,
294286 )
295- @mark_hypothesis
296287 def test_same_from_utc (self , dt , key ):
297288 py_zi = py_zoneinfo .ZoneInfo (key )
298289 c_zi = c_zoneinfo .ZoneInfo (key )
@@ -334,7 +325,6 @@ def test_same_from_utc(self, dt, key):
334325 @hypothesis .example (dt = datetime .datetime .min , key = "America/New_York" )
335326 @hypothesis .example (dt = datetime .datetime .min , key = "Asia/Tokyo" )
336327 @hypothesis .example (dt = datetime .datetime .max , key = "Asia/Tokyo" )
337- @mark_hypothesis
338328 def test_same_to_utc (self , dt , key ):
339329 py_dt = dt .replace (tzinfo = py_zoneinfo .ZoneInfo (key ))
340330 c_dt = dt .replace (tzinfo = c_zoneinfo .ZoneInfo (key ))
@@ -362,7 +352,6 @@ def test_same_to_utc(self, dt, key):
362352
363353 @hypothesis .given (key = valid_keys ())
364354 @add_key_examples
365- @mark_hypothesis
366355 def test_cross_module_pickle (self , key ):
367356 py_zi = py_zoneinfo .ZoneInfo (key )
368357 c_zi = c_zoneinfo .ZoneInfo (key )
0 commit comments