|
29 | 29 | from poetry.installation.operations import Uninstall
|
30 | 30 | from poetry.installation.operations import Update
|
31 | 31 | from poetry.installation.wheel_installer import WheelInstaller
|
32 |
| -from poetry.repositories.pypi_repository import PyPiRepository |
33 | 32 | from poetry.repositories.repository_pool import RepositoryPool
|
34 | 33 | from poetry.utils.cache import ArtifactCache
|
35 | 34 | from poetry.utils.env import MockEnv
|
|
43 | 42 |
|
44 | 43 | from poetry.config.config import Config
|
45 | 44 | from poetry.installation.operations.operation import Operation
|
| 45 | + from poetry.repositories.pypi_repository import PyPiRepository |
46 | 46 | from poetry.utils.env import VirtualEnv
|
47 | 47 | from tests.types import FixtureDirGetter
|
48 | 48 |
|
@@ -125,7 +125,9 @@ def io_not_decorated() -> BufferedIO:
|
125 | 125 | @pytest.fixture
|
126 | 126 | def pool(pypi_repository: PyPiRepository) -> RepositoryPool:
|
127 | 127 | pool = RepositoryPool()
|
128 |
| - pool.add_repository(PyPiRepository(fallback=False)) |
| 128 | + |
| 129 | + pypi_repository._fallback = True |
| 130 | + pool.add_repository(pypi_repository) |
129 | 131 |
|
130 | 132 | return pool
|
131 | 133 |
|
@@ -161,7 +163,6 @@ def test_execute_executes_a_batch_of_operations(
|
161 | 163 | pool: RepositoryPool,
|
162 | 164 | io: BufferedIO,
|
163 | 165 | tmp_path: Path,
|
164 |
| - mock_file_downloads: None, |
165 | 166 | env: MockEnv,
|
166 | 167 | copy_wheel: Callable[[], Path],
|
167 | 168 | fixture_dir: FixtureDirGetter,
|
@@ -274,7 +275,6 @@ def test_execute_prints_warning_for_yanked_package(
|
274 | 275 | pool: RepositoryPool,
|
275 | 276 | io: BufferedIO,
|
276 | 277 | tmp_path: Path,
|
277 |
| - mock_file_downloads: None, |
278 | 278 | env: MockEnv,
|
279 | 279 | operations: list[Operation],
|
280 | 280 | has_warning: bool,
|
@@ -308,7 +308,6 @@ def test_execute_prints_warning_for_invalid_wheels(
|
308 | 308 | pool: RepositoryPool,
|
309 | 309 | io: BufferedIO,
|
310 | 310 | tmp_path: Path,
|
311 |
| - mock_file_downloads: None, |
312 | 311 | env: MockEnv,
|
313 | 312 | ) -> None:
|
314 | 313 | config.merge({"cache-dir": str(tmp_path)})
|
@@ -423,7 +422,6 @@ def test_execute_works_with_ansi_output(
|
423 | 422 | pool: RepositoryPool,
|
424 | 423 | io_decorated: BufferedIO,
|
425 | 424 | tmp_path: Path,
|
426 |
| - mock_file_downloads: None, |
427 | 425 | env: MockEnv,
|
428 | 426 | ) -> None:
|
429 | 427 | config.merge({"cache-dir": str(tmp_path)})
|
@@ -460,7 +458,6 @@ def test_execute_works_with_no_ansi_output(
|
460 | 458 | pool: RepositoryPool,
|
461 | 459 | io_not_decorated: BufferedIO,
|
462 | 460 | tmp_path: Path,
|
463 |
| - mock_file_downloads: None, |
464 | 461 | env: MockEnv,
|
465 | 462 | ) -> None:
|
466 | 463 | config.merge({"cache-dir": str(tmp_path)})
|
@@ -547,7 +544,6 @@ def test_executor_should_delete_incomplete_downloads(
|
547 | 544 | tmp_path: Path,
|
548 | 545 | mocker: MockerFixture,
|
549 | 546 | pool: RepositoryPool,
|
550 |
| - mock_file_downloads: None, |
551 | 547 | env: MockEnv,
|
552 | 548 | ) -> None:
|
553 | 549 | cached_archive = tmp_path / "tomlkit-0.5.3-py2.py3-none-any.whl"
|
@@ -694,7 +690,6 @@ def test_executor_should_write_pep610_url_references_for_non_wheel_files(
|
694 | 690 | config: Config,
|
695 | 691 | io: BufferedIO,
|
696 | 692 | fixture_dir: FixtureDirGetter,
|
697 |
| - mock_file_downloads: None, |
698 | 693 | ) -> None:
|
699 | 694 | url = (fixture_dir("distributions") / "demo-0.1.0.tar.gz").resolve()
|
700 | 695 | package = Package("demo", "0.1.0", source_type="file", source_url=url.as_posix())
|
@@ -790,7 +785,6 @@ def test_executor_should_write_pep610_url_references_for_wheel_urls(
|
790 | 785 | pool: RepositoryPool,
|
791 | 786 | config: Config,
|
792 | 787 | io: BufferedIO,
|
793 |
| - mock_file_downloads: None, |
794 | 788 | mocker: MockerFixture,
|
795 | 789 | fixture_dir: FixtureDirGetter,
|
796 | 790 | is_artifact_cached: bool,
|
@@ -866,7 +860,6 @@ def test_executor_should_write_pep610_url_references_for_non_wheel_urls(
|
866 | 860 | pool: RepositoryPool,
|
867 | 861 | config: Config,
|
868 | 862 | io: BufferedIO,
|
869 |
| - mock_file_downloads: None, |
870 | 863 | mocker: MockerFixture,
|
871 | 864 | fixture_dir: FixtureDirGetter,
|
872 | 865 | is_sdist_cached: bool,
|
@@ -953,7 +946,6 @@ def test_executor_should_write_pep610_url_references_for_git(
|
953 | 946 | config: Config,
|
954 | 947 | artifact_cache: ArtifactCache,
|
955 | 948 | io: BufferedIO,
|
956 |
| - mock_file_downloads: None, |
957 | 949 | wheel: Path,
|
958 | 950 | mocker: MockerFixture,
|
959 | 951 | fixture_dir: FixtureDirGetter,
|
@@ -1017,7 +1009,6 @@ def test_executor_should_write_pep610_url_references_for_editable_git(
|
1017 | 1009 | config: Config,
|
1018 | 1010 | artifact_cache: ArtifactCache,
|
1019 | 1011 | io: BufferedIO,
|
1020 |
| - mock_file_downloads: None, |
1021 | 1012 | wheel: Path,
|
1022 | 1013 | mocker: MockerFixture,
|
1023 | 1014 | fixture_dir: FixtureDirGetter,
|
@@ -1066,7 +1057,6 @@ def test_executor_should_append_subdirectory_for_git(
|
1066 | 1057 | config: Config,
|
1067 | 1058 | artifact_cache: ArtifactCache,
|
1068 | 1059 | io: BufferedIO,
|
1069 |
| - mock_file_downloads: None, |
1070 | 1060 | wheel: Path,
|
1071 | 1061 | ) -> None:
|
1072 | 1062 | package = Package(
|
@@ -1097,7 +1087,6 @@ def test_executor_should_write_pep610_url_references_for_git_with_subdirectories
|
1097 | 1087 | config: Config,
|
1098 | 1088 | artifact_cache: ArtifactCache,
|
1099 | 1089 | io: BufferedIO,
|
1100 |
| - mock_file_downloads: None, |
1101 | 1090 | wheel: Path,
|
1102 | 1091 | ) -> None:
|
1103 | 1092 | package = Package(
|
@@ -1168,7 +1157,6 @@ def test_executor_fallback_on_poetry_create_error_without_wheel_installer(
|
1168 | 1157 | pool: RepositoryPool,
|
1169 | 1158 | io: BufferedIO,
|
1170 | 1159 | tmp_path: Path,
|
1171 |
| - mock_file_downloads: None, |
1172 | 1160 | env: MockEnv,
|
1173 | 1161 | fixture_dir: FixtureDirGetter,
|
1174 | 1162 | ) -> None:
|
@@ -1244,7 +1232,6 @@ def test_build_backend_errors_are_reported_correctly_if_caused_by_subprocess(
|
1244 | 1232 | config: Config,
|
1245 | 1233 | pool: RepositoryPool,
|
1246 | 1234 | io: BufferedIO,
|
1247 |
| - mock_file_downloads: None, |
1248 | 1235 | env: MockEnv,
|
1249 | 1236 | fixture_dir: FixtureDirGetter,
|
1250 | 1237 | ) -> None:
|
@@ -1313,7 +1300,6 @@ def test_build_backend_errors_are_reported_correctly_if_caused_by_subprocess_enc
|
1313 | 1300 | config: Config,
|
1314 | 1301 | pool: RepositoryPool,
|
1315 | 1302 | io: BufferedIO,
|
1316 |
| - mock_file_downloads: None, |
1317 | 1303 | env: MockEnv,
|
1318 | 1304 | fixture_dir: FixtureDirGetter,
|
1319 | 1305 | ) -> None:
|
@@ -1349,7 +1335,6 @@ def test_build_system_requires_not_available(
|
1349 | 1335 | config: Config,
|
1350 | 1336 | pool: RepositoryPool,
|
1351 | 1337 | io: BufferedIO,
|
1352 |
| - mock_file_downloads: None, |
1353 | 1338 | env: MockEnv,
|
1354 | 1339 | fixture_dir: FixtureDirGetter,
|
1355 | 1340 | ) -> None:
|
@@ -1395,7 +1380,6 @@ def test_build_system_requires_install_failure(
|
1395 | 1380 | config: Config,
|
1396 | 1381 | pool: RepositoryPool,
|
1397 | 1382 | io: BufferedIO,
|
1398 |
| - mock_file_downloads: None, |
1399 | 1383 | env: MockEnv,
|
1400 | 1384 | fixture_dir: FixtureDirGetter,
|
1401 | 1385 | ) -> None:
|
@@ -1450,7 +1434,6 @@ def test_other_error(
|
1450 | 1434 | config: Config,
|
1451 | 1435 | pool: RepositoryPool,
|
1452 | 1436 | io: BufferedIO,
|
1453 |
| - mock_file_downloads: None, |
1454 | 1437 | env: MockEnv,
|
1455 | 1438 | fixture_dir: FixtureDirGetter,
|
1456 | 1439 | ) -> None:
|
@@ -1562,7 +1545,6 @@ def test_executor_known_hashes(
|
1562 | 1545 | config: Config,
|
1563 | 1546 | io: BufferedIO,
|
1564 | 1547 | fixture_dir: FixtureDirGetter,
|
1565 |
| - mock_file_downloads: None, |
1566 | 1548 | ) -> None:
|
1567 | 1549 | # when installing sdist, an isolated build environment is required to extract metadata
|
1568 | 1550 | # this will install any build system requirements into the environment, to avoid failures when
|
|
0 commit comments