Skip to content

Commit db699db

Browse files
authored
gh-136297: Fix hypothesis and subTest usage in test_zoneinfo_property.py (#136384)
1 parent 5193400 commit db699db

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

Lib/test/test_zoneinfo/test_zoneinfo_property.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,23 +147,21 @@ def setUp(self):
147147
def test_pickle_unpickle_cache(self, key):
148148
zi = self.klass(key)
149149
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
150-
with self.subTest(proto=proto):
151-
pkl_str = pickle.dumps(zi, proto)
152-
zi_rt = pickle.loads(pkl_str)
150+
pkl_str = pickle.dumps(zi, proto)
151+
zi_rt = pickle.loads(pkl_str)
153152

154-
self.assertIs(zi, zi_rt)
153+
self.assertIs(zi, zi_rt)
155154

156155
@hypothesis.given(key=valid_keys())
157156
@add_key_examples
158157
def test_pickle_unpickle_no_cache(self, key):
159158
zi = self.klass.no_cache(key)
160159
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
161-
with self.subTest(proto=proto):
162-
pkl_str = pickle.dumps(zi, proto)
163-
zi_rt = pickle.loads(pkl_str)
160+
pkl_str = pickle.dumps(zi, proto)
161+
zi_rt = pickle.loads(pkl_str)
164162

165-
self.assertIsNot(zi, zi_rt)
166-
self.assertEqual(str(zi), str(zi_rt))
163+
self.assertIsNot(zi, zi_rt)
164+
self.assertEqual(str(zi), str(zi_rt))
167165

168166
@hypothesis.given(key=valid_keys())
169167
@add_key_examples

Tools/requirements-hypothesis.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Requirements file for hypothesis that
22
# we use to run our property-based tests in CI.
33

4-
hypothesis==6.111.2
4+
hypothesis==6.135.26

0 commit comments

Comments
 (0)