summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_os.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 34cd27b..66aece2 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -913,6 +913,13 @@ class UtimeTests(unittest.TestCase):
os.utime(self.fname, None)
self._test_utime_current(set_time)
+ def test_utime_nonexistent(self):
+ now = time.time()
+ filename = 'nonexistent'
+ with self.assertRaises(FileNotFoundError) as cm:
+ os.utime(filename, (now, now))
+ self.assertEqual(cm.exception.filename, filename)
+
def get_file_system(self, path):
if sys.platform == 'win32':
root = os.path.splitdrive(os.path.abspath(path))[0] + '\\'