mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-81057: Move OS-Related Globals to _PyRuntimeState (gh-100082)
https://github.com/python/cpython/issues/81057
This commit is contained in:
parent
c85be734d1
commit
cda9f0236f
14 changed files with 107 additions and 27 deletions
|
@ -606,12 +606,13 @@ class StatAttributeTests(unittest.TestCase):
|
|||
def test_stat_result_pickle(self):
|
||||
result = os.stat(self.fname)
|
||||
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
|
||||
p = pickle.dumps(result, proto)
|
||||
self.assertIn(b'stat_result', p)
|
||||
if proto < 4:
|
||||
self.assertIn(b'cos\nstat_result\n', p)
|
||||
unpickled = pickle.loads(p)
|
||||
self.assertEqual(result, unpickled)
|
||||
with self.subTest(f'protocol {proto}'):
|
||||
p = pickle.dumps(result, proto)
|
||||
self.assertIn(b'stat_result', p)
|
||||
if proto < 4:
|
||||
self.assertIn(b'cos\nstat_result\n', p)
|
||||
unpickled = pickle.loads(p)
|
||||
self.assertEqual(result, unpickled)
|
||||
|
||||
@unittest.skipUnless(hasattr(os, 'statvfs'), 'test needs os.statvfs()')
|
||||
def test_statvfs_attributes(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue