MCPcopy
hub / github.com/conda/conda / test_safety_checks_warn

Function test_safety_checks_warn

tests/test_create.py:290–324  ·  view source on GitHub ↗
(
    tmp_env: TmpEnvFixture,
    monkeypatch: MonkeyPatch,
    conda_cli: CondaCLIFixture,
)

Source from the content-addressed store, hash-verified

288
289
290def test_safety_checks_warn(
291 tmp_env: TmpEnvFixture,
292 monkeypatch: MonkeyPatch,
293 conda_cli: CondaCLIFixture,
294):
295 with tmp_env() as prefix:
296 monkeypatch.setenv("CONDA_SAFETY_CHECKS", "warn")
297 monkeypatch.setenv("CONDA_EXTRA_SAFETY_CHECKS", "true")
298 reset_context()
299 assert context.safety_checks is SafetyChecks.warn
300 assert context.extra_safety_checks
301
302 stdout, stderr, code = conda_cli(
303 "install",
304 f"--prefix={prefix}",
305 "--channel=conda-test",
306 "spiffy-test-app=0.5",
307 "--yes",
308 )
309 assert stdout
310 # conda-test::spiffy-test-app=0.5 is a modified version of conda-test::spiffy-test-app=1.0
311 assert (
312 dals(
313 """
314 The path 'site-packages/spiffy_test_app-1.0-py2.7.egg-info/top_level.txt'
315 has an incorrect size.
316 reported size: 32 bytes
317 actual size: 16 bytes
318 """
319 )
320 in stderr
321 )
322 assert "has a sha256 mismatch." in stderr
323 assert not code
324 assert package_is_installed(prefix, "spiffy-test-app=0.5")
325
326
327def test_safety_checks_disabled(

Callers

nothing calls this directly

Calls 5

reset_contextFunction · 0.90
dalsFunction · 0.90
package_is_installedFunction · 0.90
tmp_envFunction · 0.85
conda_cliFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…