Files
lix/tests/functional2/lang/err_context/test_err_context.py
T
84fb93a009 testlib: default nix fixture to also test all daemon protocols (1/3)
This first geralizes the `nix` fixture with `pytest_generate_tests` to
iterate over all protocols (unless they are marked with `no_daemon`),
though for now the list of protocols is set to be empty. The lang tests
are all tagged with `no_daemon` because they are mostly pure and running
them multiple times would be wasteful.

Co-authored-by: rootile <lix@rootile.de>
Co-authored-by: piegames <git@piegames.de>
Change-Id: Ib407edb420ba4bf434cacf9563a71f5ae6fa8eef
2026-06-28 13:45:46 +02:00

15 lines
460 B
Python

from testlib.fixtures.nix import Nix
import pytest
pytestmark = pytest.mark.no_daemon
def test_err_context(nix: Nix):
# the lang test framework doesn't check this folder, as there is a custom test in here
# it won't scream about missing an `in.nix` or .exp files
result = nix.nix_instantiate(
["--show-trace", "--eval", "-E", 'builtins.addErrorContext "Hello" (throw "Foo")']
).run()
assert "Hello" in result.expect(1).stderr_s