|
11 | 11 | import sysconfig
|
12 | 12 | from contextlib import suppress
|
13 | 13 | from inspect import cleandoc
|
14 |
| -from unittest.mock import Mock |
15 | 14 | from zipfile import ZipFile
|
16 | 15 |
|
17 | 16 | import jaraco.path
|
18 | 17 | import pytest
|
19 | 18 | from packaging import tags
|
20 | 19 |
|
21 | 20 | import setuptools
|
22 |
| -from setuptools.command.bdist_wheel import ( |
23 |
| - bdist_wheel, |
24 |
| - get_abi_tag, |
25 |
| - remove_readonly, |
26 |
| - remove_readonly_exc, |
27 |
| -) |
| 21 | +from setuptools.command.bdist_wheel import bdist_wheel, get_abi_tag |
28 | 22 | from setuptools.dist import Distribution
|
29 | 23 | from setuptools.warnings import SetuptoolsDeprecationWarning
|
30 | 24 |
|
@@ -510,29 +504,6 @@ def test_platform_with_space(dummy_dist, monkeypatch):
|
510 | 504 | bdist_wheel_cmd(plat_name="isilon onefs").run()
|
511 | 505 |
|
512 | 506 |
|
513 |
| -def test_rmtree_readonly(monkeypatch, tmp_path): |
514 |
| - """Verify onerr works as expected""" |
515 |
| - |
516 |
| - bdist_dir = tmp_path / "with_readonly" |
517 |
| - bdist_dir.mkdir() |
518 |
| - some_file = bdist_dir.joinpath("file.txt") |
519 |
| - some_file.touch() |
520 |
| - some_file.chmod(stat.S_IREAD) |
521 |
| - |
522 |
| - expected_count = 1 if sys.platform.startswith("win") else 0 |
523 |
| - |
524 |
| - if sys.version_info < (3, 12): |
525 |
| - count_remove_readonly = Mock(side_effect=remove_readonly) |
526 |
| - shutil.rmtree(bdist_dir, onerror=count_remove_readonly) |
527 |
| - assert count_remove_readonly.call_count == expected_count |
528 |
| - else: |
529 |
| - count_remove_readonly_exc = Mock(side_effect=remove_readonly_exc) |
530 |
| - shutil.rmtree(bdist_dir, onexc=count_remove_readonly_exc) |
531 |
| - assert count_remove_readonly_exc.call_count == expected_count |
532 |
| - |
533 |
| - assert not bdist_dir.is_dir() |
534 |
| - |
535 |
| - |
536 | 507 | def test_data_dir_with_tag_build(monkeypatch, tmp_path):
|
537 | 508 | """
|
538 | 509 | Setuptools allow authors to set PEP 440's local version segments
|
|
0 commit comments