diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -1395,6 +1395,13 @@ self.assertTrue(p.exists()) self.assertRaises(OSError, p.touch, exist_ok=False) + def test_touch_nochange(self): + P = self.cls(BASE) + p = P / 'fileA' + p.touch() + with (P / 'fileA').open('rb') as f: + self.assertEqual(f.read().strip(), b"this is file A") + def test_mkdir(self): P = self.cls(BASE) p = P / 'newdirA'