@@ -166,78 +166,6 @@ def check_binary_allowed(req):
166166 assert should_cache is expected
167167
168168
169- @pytest .mark .parametrize (
170- "base_name, should_unpack, cache_available, expected" ,
171- [
172- ('pendulum-2.0.4' , False , False , False ),
173- # The following cases test should_unpack=True.
174- # Test _contains_egg_info() returning True.
175- ('pendulum-2.0.4' , True , True , False ),
176- ('pendulum-2.0.4' , True , False , True ),
177- # Test _contains_egg_info() returning False.
178- ('pendulum' , True , True , True ),
179- ('pendulum' , True , False , True ),
180- ],
181- )
182- def test_should_use_ephemeral_cache__issue_6197 (
183- base_name , should_unpack , cache_available , expected ,
184- ):
185- """
186- Regression test for: https://github.com/pypa/pip/issues/6197
187- """
188- req = make_test_install_req (base_name = base_name )
189- assert not req .is_wheel
190- assert not req .link .is_vcs
191-
192- always_true = Mock (return_value = True )
193-
194- ephem_cache = wheel .should_use_ephemeral_cache (
195- req , should_unpack = should_unpack ,
196- cache_available = cache_available , check_binary_allowed = always_true ,
197- )
198- assert ephem_cache is expected
199-
200-
201- @pytest .mark .parametrize (
202- "disallow_binaries, expected" ,
203- [
204- # By default (i.e. when binaries are allowed), VCS requirements
205- # should be built.
206- (False , True ),
207- # Disallowing binaries, however, should cause them not to be built.
208- (True , None ),
209- ],
210- )
211- def test_should_use_ephemeral_cache__disallow_binaries_and_vcs_checkout (
212- disallow_binaries , expected ,
213- ):
214- """
215- Test that disallowing binaries (e.g. from passing --global-option)
216- causes should_use_ephemeral_cache() to return None for VCS checkouts.
217- """
218- req = Requirement ('pendulum' )
219- link = Link (url = 'git+https://git.example.com/pendulum.git' )
220- req = InstallRequirement (
221- req = req ,
222- comes_from = None ,
223- constraint = False ,
224- editable = False ,
225- link = link ,
226- source_dir = '/tmp/pip-install-9py5m2z1/pendulum' ,
227- )
228- assert not req .is_wheel
229- assert req .link .is_vcs
230-
231- check_binary_allowed = Mock (return_value = not disallow_binaries )
232-
233- # The cache_available value doesn't matter for this test.
234- ephem_cache = wheel .should_use_ephemeral_cache (
235- req , should_unpack = True ,
236- cache_available = True , check_binary_allowed = check_binary_allowed ,
237- )
238- assert ephem_cache is expected
239-
240-
241169def test_format_command_result__INFO (caplog ):
242170 caplog .set_level (logging .INFO )
243171 actual = wheel .format_command_result (
0 commit comments