Files
lix/tests/functional2/eval/test_experimental_features.py
T
Commentator2.0andRutile 7869385b98 tests/functional2: Make Command Environment actually declarative
So far, the environment used by `command` was completely leaky and the
one used by `nix` was very leaky despite it trying to be a "hermetic"
environment.
This commit moves the hermaticity to `command` and changes its
implementation to be not leak anything.

To achieve this, the following changes were also nessecary:
- the `files` and `snapshot` fixture now use the folder `test-home`
within the tmp_path directory by default, as the `HOME` environment
variable is set to there. (extraction not possible due to dependencies
of command etc also using this directory)

Fixes: #847, #848

Change-Id: I55f86ee0e1615e73fcf442ee2f28f3b89893bbb4
2025-08-15 06:56:07 +00:00

12 lines
406 B
Python

from functional2.testlib.fixtures.nix import Nix
# ruff: noqa: N802
def test_fetchTree_presence(nix: Nix):
"""Ensures that fetchTree is actually absent if flakes are disabled"""
settings = nix.settings.feature("nix-command")
assert nix.eval("builtins ? fetchTree", settings).json() is False
settings.feature("flakes")
assert nix.eval("builtins ? fetchTree", settings).json() is True