Skip to content

Commit 94a46e2

Browse files
committed
fixup test_environment: improve error reporting
1 parent 19a0c37 commit 94a46e2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_environment.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ def assert_env_matches(
6262
if not env_accepts_null():
6363
e.pop("LC_CTYPE", None)
6464
e.pop("__CF_USER_TEXT_ENCODING", None)
65-
assert len(e) == 0, f"Unexpected environment variable(s): {', '.join(e.keys())}"
65+
assert (
66+
len(e) == 0
67+
), f"Unexpected environment variable(s): {', '.join(e.keys())} from env {env}."
6668

6769

6870
class CheckHolder(ABC):
@@ -311,6 +313,7 @@ def test_preserve_all(
311313
assert_envvar_matches(checks[vname], vname, env)
312314
except KeyError as kerr:
313315
if vname not in os.environ:
316+
print(env)
314317
raise kerr
315318
assert val == os.environ[vname]
316319
except AssertionError:

0 commit comments

Comments
 (0)