summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Kaczmarczyk <andrzej.kaczmarczyk@agh.edu.pl>2022-11-29 01:11:57 +0100
committerAndrzej Kaczmarczyk <andrzej.kaczmarczyk@agh.edu.pl>2022-11-29 01:15:19 +0100
commitdedbb8f9eb3275aa11f430168e389bded5825b4e (patch)
tree337312decb827a0601e50fd0add6e6a2999efcdd
parentfb3313fe7fb650c822e9ec89660915b37b7d891e (diff)
downloadpython-setuptools-git-dedbb8f9eb3275aa11f430168e389bded5825b4e.tar.gz
Test added. Ref #3667.
-rw-r--r--setuptools/tests/test_egg_info.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py
index 387773c1..cf4b6435 100644
--- a/setuptools/tests/test_egg_info.py
+++ b/setuptools/tests/test_egg_info.py
@@ -7,6 +7,7 @@ import stat
import time
from typing import List, Tuple
from pathlib import Path
+from unittest import mock
import pytest
from jaraco import path
@@ -158,6 +159,16 @@ class TestEggInfo:
]
assert sorted(actual) == expected
+ def test_handling_utime_error(self, tmpdir_cwd, env):
+ dist = Distribution()
+ ei = egg_info(dist)
+ with mock.patch('os.utime', side_effect=OSError("TEST")),\
+ mock.patch('setuptools.command.egg_info.egg_info.mkpath', return_val=None):
+ import distutils.errors
+ with pytest.raises(distutils.errors.DistutilsFileError, match =
+ r"Cannot update time stamp of directory 'None'"):
+ ei.run()
+
def test_license_is_a_string(self, tmpdir_cwd, env):
setup_config = DALS("""
[metadata]