Skip to content

Commit dedbb8f

Browse files
committed
Test added. Ref #3667.
1 parent fb3313f commit dedbb8f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

setuptools/tests/test_egg_info.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import time
88
from typing import List, Tuple
99
from pathlib import Path
10+
from unittest import mock
1011

1112
import pytest
1213
from jaraco import path
@@ -158,6 +159,16 @@ def test_expected_files_produced(self, tmpdir_cwd, env):
158159
]
159160
assert sorted(actual) == expected
160161

162+
def test_handling_utime_error(self, tmpdir_cwd, env):
163+
dist = Distribution()
164+
ei = egg_info(dist)
165+
with mock.patch('os.utime', side_effect=OSError("TEST")),\
166+
mock.patch('setuptools.command.egg_info.egg_info.mkpath', return_val=None):
167+
import distutils.errors
168+
with pytest.raises(distutils.errors.DistutilsFileError, match =
169+
r"Cannot update time stamp of directory 'None'"):
170+
ei.run()
171+
161172
def test_license_is_a_string(self, tmpdir_cwd, env):
162173
setup_config = DALS("""
163174
[metadata]

0 commit comments

Comments
 (0)