nixpkgs/nixos/lib
Robert Hensing 56d9637119
nixos/testing: Set up scope for testScript linter
Our test driver exposes a bunch of variables and functions, which
pyflakes doesn't recognise by default because it assumes that the test
script is executed standalone. In reality however the test driver script
is using exec() on the testScript.

Fortunately pyflakes has $PYFLAKES_BUILTINS, which are the attributes
that are globally available on all modules to be checked. Since we only
have one module, using this environment variable is fine as opposed to
my first approach to this, which tried to use the unstable internal API
of pyflakes.

The attributes are gathered by the main derivation of the test driver,
because we don't want to end up defining a new attribute in the test
driver module just to being confused why using it in a test will result
in an error.

Another way we could have gathered these attributes would be in
mkDriver, which is where the linting takes place. However, we do have a
different set of Python dependencies in scope and duplicating these will
again just cause confusion over having it at one location only.

Signed-off-by: aszlig <aszlig@nix.build>
Co-Authored-By: aszlig <aszlig@nix.build>
2021-05-09 02:26:51 +02:00
..
make-options-doc nixosOptionsDoc: add markdown formatting 2021-04-13 10:10:40 -07:00
test-driver nixos/test-driver: Allow interactive testing on Wayland-only setups 2021-05-04 16:23:02 +02:00
build-vms.nix
eval-config.nix
from-env.nix
make-channel.nix
make-disk-image.nix Merge pull request #120489 from samueldr/fix/make-disk-image-auto-size 2021-04-26 10:34:15 +02:00
make-ext4-fs.nix
make-iso9660-image.nix
make-iso9660-image.sh
make-squashfs.nix
make-system-tarball.nix
make-system-tarball.sh
qemu-flags.nix nixos/qemu-flags: add ppc64 2021-03-05 01:57:54 -08:00
testing-python.nix nixos/testing: Set up scope for testScript linter 2021-05-09 02:26:51 +02:00
utils.nix