summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/lib/testing-python.nix10
-rw-r--r--nixos/tests/make-test-python.nix4
2 files changed, 9 insertions, 5 deletions
diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix
index f63b6c78f6d..d7204a2bc14 100644
--- a/nixos/lib/testing-python.nix
+++ b/nixos/lib/testing-python.nix
@@ -29,7 +29,9 @@ rec {
     };
   };
 
-  # Make a full-blown test
+  # Make a full-blown test (legacy)
+  # For an official public interface to the tests, see
+  # https://nixos.org/manual/nixos/unstable/index.html#sec-calling-nixos-tests
   makeTest =
     { machine ? null
     , nodes ? {}
@@ -48,7 +50,8 @@ rec {
           else builtins.unsafeGetAttrPos "testScript" t)
     , extraPythonPackages ? (_ : [])
     , interactive ? {}
-    } @ t:
+    } @ t: let
+    testConfig =
       (evalTest {
         imports = [
           { _file = "makeTest parameters"; config = t; }
@@ -60,6 +63,9 @@ rec {
           }
         ];
       }).config;
+    in
+      testConfig.test   # For nix-build
+        // testConfig;  # For all-tests.nix
 
   simpleTest = as: (makeTest as).test;
 
diff --git a/nixos/tests/make-test-python.nix b/nixos/tests/make-test-python.nix
index c3bbd674237..7a96f538d8d 100644
--- a/nixos/tests/make-test-python.nix
+++ b/nixos/tests/make-test-python.nix
@@ -6,6 +6,4 @@ f: {
 
 with import ../lib/testing-python.nix { inherit system pkgs; };
 
-let testConfig = makeTest (if pkgs.lib.isFunction f then f (args // { inherit pkgs; inherit (pkgs) lib; }) else f);
-in testConfig.test   # For nix-build
-     // testConfig   # For all-tests.nix
+makeTest (if pkgs.lib.isFunction f then f (args // { inherit pkgs; inherit (pkgs) lib; }) else f)