MCPcopy
hub / github.com/conda/conda / test_create_empty_env

Function test_create_empty_env

tests/test_create.py:760–790  ·  view source on GitHub ↗
(tmp_env: TmpEnvFixture, conda_cli: CondaCLIFixture)

Source from the content-addressed store, hash-verified

758
759
760def test_create_empty_env(tmp_env: TmpEnvFixture, conda_cli: CondaCLIFixture):
761 with tmp_env(shallow=False) as prefix:
762 assert (prefix / PREFIX_MAGIC_FILE).exists()
763
764 stdout, stderr, code = conda_cli("list", f"--prefix={prefix}")
765 assert stdout == dals(
766 f"""
767 # packages in environment at {prefix}:
768 #
769 # Name Version Build Channel
770 """
771 )
772 assert not stderr
773 assert not code
774
775 stdout, stderr, code = conda_cli(
776 "list",
777 f"--prefix={prefix}",
778 "--revisions",
779 "--json",
780 )
781 revisions = json.loads(stdout)
782 assert len(revisions) == 1
783 assert datetime.fromisoformat(revisions[0]["date"])
784 assert revisions[0]["downgrade"] == []
785 assert revisions[0]["install"] == []
786 assert revisions[0]["remove"] == []
787 assert revisions[0]["rev"] == 0
788 assert revisions[0]["upgrade"] == []
789 assert not stderr
790 assert not code
791
792
793@pytest.mark.skipif(reason="conda-forge doesn't have a full set of packages")

Callers

nothing calls this directly

Calls 4

dalsFunction · 0.90
tmp_envFunction · 0.85
conda_cliFunction · 0.85
existsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…