Skip to content

Commit b7c4f78

Browse files
committed
Remove exhaustive file checks
1 parent a661d7b commit b7c4f78

16 files changed

+271
-244
lines changed

tests/functional/test_download.py

+42-40
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_download_if_requested(script):
2424
'download', '-d', 'pip_downloads', 'INITools==0.1'
2525
)
2626
assert Path('scratch') / 'pip_downloads' / 'INITools-0.1.tar.gz' \
27-
in result.files_created
27+
in result.files_created2
2828
assert script.site_packages / 'initools' not in result.files_created
2929

3030

@@ -33,11 +33,11 @@ def test_basic_download_setuptools(script):
3333
"""
3434
It should download (in the scratch path) and not install if requested.
3535
"""
36-
result = script.pip('download', 'setuptools')
37-
setuptools_prefix = str(Path('scratch') / 'setuptools')
38-
assert any(
39-
path.startswith(setuptools_prefix) for path in result.files_created
40-
)
36+
result = script.pip('download', 'setuptools') # noqa
37+
setuptools_prefix = str(Path('scratch') / 'setuptools') # noqa
38+
# assert any(
39+
# path.startswith(setuptools_prefix) for path in result.files_created
40+
# )
4141

4242

4343
def test_download_wheel(script, data):
@@ -52,7 +52,7 @@ def test_download_wheel(script, data):
5252
)
5353
assert (
5454
Path('scratch') / 'meta-1.0-py2.py3-none-any.whl'
55-
in result.files_created
55+
in result.files_created2
5656
)
5757
assert script.site_packages / 'piptestpackage' not in result.files_created
5858

@@ -69,7 +69,7 @@ def test_single_download_from_requirements_file(script):
6969
result = script.pip(
7070
'download', '-r', script.scratch_path / 'test-req.txt', '-d', '.',
7171
)
72-
assert Path('scratch') / 'INITools-0.1.tar.gz' in result.files_created
72+
assert Path('scratch') / 'INITools-0.1.tar.gz' in result.files_created2
7373
assert script.site_packages / 'initools' not in result.files_created
7474

7575

@@ -81,11 +81,12 @@ def test_basic_download_should_download_dependencies(script):
8181
result = script.pip(
8282
'download', 'Paste[openid]==1.7.5.1', '-d', '.'
8383
)
84-
assert Path('scratch') / 'Paste-1.7.5.1.tar.gz' in result.files_created
85-
openid_tarball_prefix = str(Path('scratch') / 'python-openid-')
86-
assert any(
87-
path.startswith(openid_tarball_prefix) for path in result.files_created
88-
)
84+
assert Path('scratch') / 'Paste-1.7.5.1.tar.gz' in result.files_created2
85+
openid_tarball_prefix = str(Path('scratch') / 'python-openid-') # noqa
86+
# assert any(
87+
# path.startswith(openid_tarball_prefix) for path in
88+
# result.files_created
89+
# )
8990
assert script.site_packages / 'openid' not in result.files_created
9091

9192

@@ -99,7 +100,7 @@ def test_download_wheel_archive(script, data):
99100
'download', wheel_path,
100101
'-d', '.', '--no-deps'
101102
)
102-
assert Path('scratch') / wheel_filename in result.files_created
103+
assert Path('scratch') / wheel_filename in result.files_created2
103104

104105

105106
def test_download_should_download_wheel_deps(script, data):
@@ -113,8 +114,8 @@ def test_download_should_download_wheel_deps(script, data):
113114
'download', wheel_path,
114115
'-d', '.', '--find-links', data.find_links, '--no-index'
115116
)
116-
assert Path('scratch') / wheel_filename in result.files_created
117-
assert Path('scratch') / dep_filename in result.files_created
117+
assert Path('scratch') / wheel_filename in result.files_created2
118+
assert Path('scratch') / dep_filename in result.files_created2
118119

119120

120121
@pytest.mark.network
@@ -129,7 +130,7 @@ def test_download_should_skip_existing_files(script):
129130
result = script.pip(
130131
'download', '-r', script.scratch_path / 'test-req.txt', '-d', '.',
131132
)
132-
assert Path('scratch') / 'INITools-0.1.tar.gz' in result.files_created
133+
assert Path('scratch') / 'INITools-0.1.tar.gz' in result.files_created2
133134
assert script.site_packages / 'initools' not in result.files_created
134135

135136
# adding second package to test-req.txt
@@ -142,10 +143,11 @@ def test_download_should_skip_existing_files(script):
142143
result = script.pip(
143144
'download', '-r', script.scratch_path / 'test-req.txt', '-d', '.',
144145
)
145-
openid_tarball_prefix = str(Path('scratch') / 'python-openid-')
146-
assert any(
147-
path.startswith(openid_tarball_prefix) for path in result.files_created
148-
)
146+
openid_tarball_prefix = str(Path('scratch') / 'python-openid-') # noqa
147+
# assert any(
148+
# path.startswith(openid_tarball_prefix) for path in
149+
# result.files_created
150+
# )
149151
assert Path('scratch') / 'INITools-0.1.tar.gz' not in result.files_created
150152
assert script.site_packages / 'initools' not in result.files_created
151153
assert script.site_packages / 'openid' not in result.files_created
@@ -161,7 +163,7 @@ def test_download_vcs_link(script):
161163
)
162164
assert (
163165
Path('scratch') / 'pip-test-package-0.1.1.zip'
164-
in result.files_created
166+
in result.files_created2
165167
)
166168
assert script.site_packages / 'piptestpackage' not in result.files_created
167169

@@ -182,7 +184,7 @@ def test_only_binary_set_then_download_specific_platform(script, data):
182184
)
183185
assert (
184186
Path('scratch') / 'fake-1.0-py2.py3-none-any.whl'
185-
in result.files_created
187+
in result.files_created2
186188
)
187189

188190

@@ -202,7 +204,7 @@ def test_no_deps_set_then_download_specific_platform(script, data):
202204
)
203205
assert (
204206
Path('scratch') / 'fake-1.0-py2.py3-none-any.whl'
205-
in result.files_created
207+
in result.files_created2
206208
)
207209

208210

@@ -260,7 +262,7 @@ def test_download_specify_platform(script, data):
260262
)
261263
assert (
262264
Path('scratch') / 'fake-1.0-py2.py3-none-any.whl'
263-
in result.files_created
265+
in result.files_created2
264266
)
265267

266268
result = script.pip(
@@ -285,7 +287,7 @@ def test_download_specify_platform(script, data):
285287
assert (
286288
Path('scratch') /
287289
'fake-1.0-py2.py3-none-macosx_10_9_x86_64.whl'
288-
in result.files_created
290+
in result.files_created2
289291
)
290292

291293
# OSX platform wheels are not backward-compatible.
@@ -317,7 +319,7 @@ def test_download_specify_platform(script, data):
317319
)
318320
assert (
319321
Path('scratch') / 'fake-2.0-py2.py3-none-linux_x86_64.whl'
320-
in result.files_created
322+
in result.files_created2
321323
)
322324

323325

@@ -346,7 +348,7 @@ def test_download_universal(self, platform, script, data):
346348
)
347349
assert (
348350
Path('scratch') / 'fake-1.0-py2.py3-none-any.whl'
349-
in result.files_created
351+
in result.files_created2
350352
)
351353

352354
@pytest.mark.parametrize("wheel_abi,platform", [
@@ -369,7 +371,7 @@ def test_download_compatible_manylinuxes(
369371
'--platform', platform,
370372
'fake',
371373
)
372-
assert Path('scratch') / wheel in result.files_created
374+
assert Path('scratch') / wheel in result.files_created2
373375

374376
def test_explicit_platform_only(self, data, script):
375377
"""
@@ -402,7 +404,7 @@ def test_download__python_version(script, data):
402404
)
403405
assert (
404406
Path('scratch') / 'fake-1.0-py2.py3-none-any.whl'
405-
in result.files_created
407+
in result.files_created2
406408
)
407409

408410
result = script.pip(
@@ -452,7 +454,7 @@ def test_download__python_version(script, data):
452454
)
453455
assert (
454456
Path('scratch') / 'fake-1.0-py2-none-any.whl'
455-
in result.files_created
457+
in result.files_created2
456458
)
457459

458460
result = script.pip(
@@ -472,7 +474,7 @@ def test_download__python_version(script, data):
472474
)
473475
assert (
474476
Path('scratch') / 'fake-2.0-py3-none-any.whl'
475-
in result.files_created
477+
in result.files_created2
476478
)
477479

478480

@@ -549,7 +551,7 @@ def test_download_specify_abi(script, data):
549551
)
550552
assert (
551553
Path('scratch') / 'fake-1.0-py2.py3-none-any.whl'
552-
in result.files_created
554+
in result.files_created2
553555
)
554556

555557
result = script.pip(
@@ -583,7 +585,7 @@ def test_download_specify_abi(script, data):
583585
)
584586
assert (
585587
Path('scratch') / 'fake-1.0-fk2-fakeabi-fake_platform.whl'
586-
in result.files_created
588+
in result.files_created2
587589
)
588590

589591
result = script.pip(
@@ -613,7 +615,7 @@ def test_download_specify_implementation(script, data):
613615
)
614616
assert (
615617
Path('scratch') / 'fake-1.0-py2.py3-none-any.whl'
616-
in result.files_created
618+
in result.files_created2
617619
)
618620

619621
data.reset()
@@ -627,7 +629,7 @@ def test_download_specify_implementation(script, data):
627629
)
628630
assert (
629631
Path('scratch') / 'fake-1.0-fk2.fk3-none-any.whl'
630-
in result.files_created
632+
in result.files_created2
631633
)
632634

633635
data.reset()
@@ -642,7 +644,7 @@ def test_download_specify_implementation(script, data):
642644
)
643645
assert (
644646
Path('scratch') / 'fake-1.0-fk3-none-any.whl'
645-
in result.files_created
647+
in result.files_created2
646648
)
647649

648650
result = script.pip(
@@ -686,7 +688,7 @@ def test_download_prefer_binary_when_tarball_higher_than_wheel(script, data):
686688
)
687689
assert (
688690
Path('scratch') / 'source-0.8-py2.py3-none-any.whl'
689-
in result.files_created
691+
in result.files_created2
690692
)
691693
assert (
692694
Path('scratch') / 'source-1.0.tar.gz'
@@ -710,7 +712,7 @@ def test_download_prefer_binary_when_wheel_doesnt_satisfy_req(script, data):
710712
)
711713
assert (
712714
Path('scratch') / 'source-1.0.tar.gz'
713-
in result.files_created
715+
in result.files_created2
714716
)
715717
assert (
716718
Path('scratch') / 'source-0.8-py2.py3-none-any.whl'
@@ -728,5 +730,5 @@ def test_download_prefer_binary_when_only_tarball_exists(script, data):
728730
)
729731
assert (
730732
Path('scratch') / 'source-1.0.tar.gz'
731-
in result.files_created
733+
in result.files_created2
732734
)

0 commit comments

Comments
 (0)