MCPcopy Create free account
hub / github.com/commitizen-tools/commitizen / test_with_env

Method test_with_env

tests/test_cmd.py:67–74  ·  view source on GitHub ↗

Test that cmd.run passes extra environment variables.

(self)

Source from the content-addressed store, hash-verified

65 assert "hello" in c.out
66
67 def test_with_env(self):
68 """Test that cmd.run passes extra environment variables."""
69 c = cmd.run(
70 ["python", "-c", "import os; print(os.environ['CZ_TEST_VAR'])"],
71 env={"CZ_TEST_VAR": "test_value"},
72 )
73 assert c.return_code == 0
74 assert "test_value" in c.out
75
76 def test_with_string_emits_deprecation_warning(self):
77 """Test that passing a string to cmd.run() emits a DeprecationWarning."""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected