summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2019-11-04 22:49:45 +0100
committerJacek Galowicz <jacek.galowicz@cyberus-technology.de>2019-11-04 23:50:27 +0100
commitac97edf013368c10c0c0978780d89b60bc520900 (patch)
treefdf7e8f745b7464e0b1f7573d4e317ed3a4d759a /nixos
parent3a28fefe7d4e7d842304ff4eee42c76593194b0a (diff)
downloadnixpkgs-ac97edf013368c10c0c0978780d89b60bc520900.tar
nixpkgs-ac97edf013368c10c0c0978780d89b60bc520900.tar.gz
nixpkgs-ac97edf013368c10c0c0978780d89b60bc520900.tar.bz2
nixpkgs-ac97edf013368c10c0c0978780d89b60bc520900.tar.lz
nixpkgs-ac97edf013368c10c0c0978780d89b60bc520900.tar.xz
nixpkgs-ac97edf013368c10c0c0978780d89b60bc520900.tar.zst
nixpkgs-ac97edf013368c10c0c0978780d89b60bc520900.zip
nixos/test: use ptpython as repl
Diffstat (limited to 'nixos')
-rw-r--r--nixos/lib/test-driver/test-driver.py8
-rw-r--r--nixos/lib/testing-python.nix2
2 files changed, 3 insertions, 7 deletions
diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py
index 16d4b0b907d..45b7e229a5c 100644
--- a/nixos/lib/test-driver/test-driver.py
+++ b/nixos/lib/test-driver/test-driver.py
@@ -15,6 +15,7 @@ import sys
 import tempfile
 import time
 import unicodedata
+import ptpython.repl
 
 CHAR_TO_KEY = {
     "A": "shift-a",
@@ -690,12 +691,7 @@ def run_tests():
                 eprint("error: {}".format(str(e)))
                 sys.exit(1)
     else:
-        while True:
-            try:
-                value = input("> ")
-                exec(value)
-            except EOFError:
-                break
+        ptpython.repl.embed(locals(), globals())
 
     # TODO: Collect coverage data
 
diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix
index 5240cba116f..21f6172e967 100644
--- a/nixos/lib/testing-python.nix
+++ b/nixos/lib/testing-python.nix
@@ -25,7 +25,7 @@ in rec {
     name = "nixos-test-driver";
 
     nativeBuildInputs = [ makeWrapper ];
-    buildInputs = [ python3 ];
+    buildInputs = [ (python3.withPackages (p: [ p.ptpython ])) ];
     checkInputs = with python3Packages; [ pylint black ];
 
     dontUnpack = true;