diff --git a/tests/pexpects/abbrs.py b/tests/pexpects/abbrs.py
index 4ec201f5d..c3f9131ee 100644
--- a/tests/pexpects/abbrs.py
+++ b/tests/pexpects/abbrs.py
@@ -1,8 +1,6 @@
 #!/usr/bin/env python3
 from pexpect_helper import SpawnedProc
 
-import re
-
 sp = SpawnedProc()
 send, sendline, sleep, expect_prompt, expect_re, expect_str = (
     sp.send,
diff --git a/tests/pexpects/disable_mouse.py b/tests/pexpects/disable_mouse.py
index bfe7fc2a3..5fe11d987 100644
--- a/tests/pexpects/disable_mouse.py
+++ b/tests/pexpects/disable_mouse.py
@@ -1,8 +1,5 @@
 #!/usr/bin/env python3
 from pexpect_helper import SpawnedProc
-import subprocess
-import sys
-import time
 
 sp = SpawnedProc(args=["-d", "reader"])
 sp.expect_prompt()
diff --git a/tests/pexpects/eval-stack-overflow.py b/tests/pexpects/eval-stack-overflow.py
index 0e435a69a..8e47ce789 100644
--- a/tests/pexpects/eval-stack-overflow.py
+++ b/tests/pexpects/eval-stack-overflow.py
@@ -2,7 +2,6 @@
 from pexpect_helper import SpawnedProc
 import re
 import os
-import platform
 import sys
 
 # Disable under SAN - keeps failing because the timing is too tight
diff --git a/tests/pexpects/exit_handlers.py b/tests/pexpects/exit_handlers.py
index ffe7a9eed..8959cc2ab 100644
--- a/tests/pexpects/exit_handlers.py
+++ b/tests/pexpects/exit_handlers.py
@@ -3,7 +3,6 @@ from pexpect_helper import SpawnedProc
 import os
 import signal
 import tempfile
-from time import sleep
 
 # Ensure that on-exit handlers run even if we get SIGHUP.
 with tempfile.NamedTemporaryFile(mode="r", encoding="utf8") as tf:
diff --git a/tests/pexpects/exit_nohang.py b/tests/pexpects/exit_nohang.py
index 0d370328a..1b5d51a61 100644
--- a/tests/pexpects/exit_nohang.py
+++ b/tests/pexpects/exit_nohang.py
@@ -1,9 +1,7 @@
 #!/usr/bin/env python3
 from pexpect_helper import SpawnedProc
-import subprocess
 import sys
 import signal
-import time
 import os
 
 sp = SpawnedProc()
diff --git a/tests/pexpects/fg.py b/tests/pexpects/fg.py
index 3cb08e53a..628306006 100644
--- a/tests/pexpects/fg.py
+++ b/tests/pexpects/fg.py
@@ -1,11 +1,7 @@
 #!/usr/bin/env python3
 from pexpect_helper import SpawnedProc
-import os
 import platform
-import signal
 import subprocess
-import sys
-import time
 
 sp = SpawnedProc()
 send, sendline, sleep, expect_prompt, expect_re, expect_str = (
diff --git a/tests/pexpects/fkr.py b/tests/pexpects/fkr.py
index 8b6c052f7..4864d9200 100644
--- a/tests/pexpects/fkr.py
+++ b/tests/pexpects/fkr.py
@@ -1,12 +1,9 @@
 #!/usr/bin/env python3
 from pexpect_helper import SpawnedProc
-import subprocess
-import sys
 from time import sleep
 import os
 
 os.environ["fish_escape_delay_ms"] = "10"
-SpawnedProc()
 sp = SpawnedProc()
 send, sendline, sleep, expect_prompt, expect_re, expect_str = (
     sp.send,
diff --git a/tests/pexpects/generic.py b/tests/pexpects/generic.py
index 01a01c24b..7c7f35fe9 100644
--- a/tests/pexpects/generic.py
+++ b/tests/pexpects/generic.py
@@ -1,11 +1,6 @@
 #!/usr/bin/env python3
 from pexpect_helper import SpawnedProc
-import subprocess
-import sys
-from time import sleep
-import os
 
-SpawnedProc()
 sp = SpawnedProc()
 send, sendline, sleep, expect_prompt, expect_re, expect_str = (
     sp.send,
diff --git a/tests/pexpects/isatty.py b/tests/pexpects/isatty.py
index 84931f277..80704d62f 100644
--- a/tests/pexpects/isatty.py
+++ b/tests/pexpects/isatty.py
@@ -1,8 +1,5 @@
 #!/usr/bin/env python3
 from pexpect_helper import SpawnedProc
-import subprocess
-import sys
-import time
 
 sp = SpawnedProc()
 send, sendline, sleep, expect_prompt, expect_re, expect_str = (
diff --git a/tests/pexpects/set_color.py b/tests/pexpects/set_color.py
index d382cce4a..2534ef3c9 100644
--- a/tests/pexpects/set_color.py
+++ b/tests/pexpects/set_color.py
@@ -1,8 +1,5 @@
 #!/usr/bin/env python3
 from pexpect_helper import SpawnedProc
-import subprocess
-import sys
-import time
 import os
 
 env = os.environ.copy()
diff --git a/tests/pexpects/status.py b/tests/pexpects/status.py
index 420a4f751..01633395a 100644
--- a/tests/pexpects/status.py
+++ b/tests/pexpects/status.py
@@ -1,8 +1,5 @@
 #!/usr/bin/env python3
 from pexpect_helper import SpawnedProc
-import os
-import platform
-import sys
 
 sp = SpawnedProc()
 send, sendline, sleep, expect_prompt, expect_re, expect_str = (
diff --git a/tests/pexpects/stdin_nonblocking.py b/tests/pexpects/stdin_nonblocking.py
index d1f6a0eeb..935315030 100644
--- a/tests/pexpects/stdin_nonblocking.py
+++ b/tests/pexpects/stdin_nonblocking.py
@@ -1,9 +1,6 @@
 #!/usr/bin/env python3
 # Verify that stdin is properly set to blocking even if a job tweaks it.
 from pexpect_helper import SpawnedProc
-import sys
-import signal
-import time
 import os
 
 sp = SpawnedProc()
diff --git a/tests/pexpects/wildcard_tab.py b/tests/pexpects/wildcard_tab.py
index 645f8bedd..c9bcd7bbd 100644
--- a/tests/pexpects/wildcard_tab.py
+++ b/tests/pexpects/wildcard_tab.py
@@ -1,5 +1,4 @@
 #!/usr/bin/env python3
-import signal
 from pexpect_helper import SpawnedProc
 
 sp = SpawnedProc()