aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_pathlib/test_pathlib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_pathlib/test_pathlib.py')
-rw-r--r--Lib/test/test_pathlib/test_pathlib.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_pathlib/test_pathlib.py b/Lib/test/test_pathlib/test_pathlib.py
index 7f61f3d6223..8900b292ad0 100644
--- a/Lib/test/test_pathlib/test_pathlib.py
+++ b/Lib/test/test_pathlib/test_pathlib.py
@@ -1440,11 +1440,13 @@ class PathTest(test_pathlib_abc.RWPathTest, PurePathTest):
if hasattr(os, 'chflags') and hasattr(stat, 'UF_NODUMP'):
os.chflags(source / 'fileC', stat.UF_NODUMP)
target = base / 'copyA'
+
+ subpaths = ['.', 'fileC', 'dirD', 'dirD/fileD']
+ source_sts = [source.joinpath(subpath).stat() for subpath in subpaths]
source.copy(target, preserve_metadata=True)
+ target_sts = [target.joinpath(subpath).stat() for subpath in subpaths]
- for subpath in ['.', 'fileC', 'dirD', 'dirD/fileD']:
- source_st = source.joinpath(subpath).stat()
- target_st = target.joinpath(subpath).stat()
+ for source_st, target_st in zip(source_sts, target_sts):
self.assertLessEqual(source_st.st_atime, target_st.st_atime)
self.assertLessEqual(source_st.st_mtime, target_st.st_mtime)
self.assertEqual(source_st.st_mode, target_st.st_mode)