From 87b14d96c89d94075a2f6b5a765612acf62a3ab0 Mon Sep 17 00:00:00 2001
From: Alexandre Abadie <alexandre.abadie@inria.fr>
Date: Tue, 12 Dec 2017 22:40:03 +0100
Subject: [PATCH] tests: fix python style E402

E402 module level import not at top of file
---
 tests/bitarithm_timings/tests/01-run.py          | 7 +++----
 tests/bloom_bytes/tests/01-run.py                | 7 +++----
 tests/buttons/tests/01-run.py                    | 7 +++----
 tests/cbor/tests/01-run.py                       | 7 +++----
 tests/cpp11_condition_variable/tests/01-run.py   | 7 +++----
 tests/cpp11_mutex/tests/01-run.py                | 7 +++----
 tests/cpp11_thread/tests/01-run.py               | 7 +++----
 tests/driver_ds1307/tests/01-run.py              | 7 +++----
 tests/driver_grove_ledbar/tests/01-run.py        | 7 +++----
 tests/driver_hd44780/tests/01-run.py             | 7 +++----
 tests/driver_my9221/tests/01-run.py              | 7 +++----
 tests/events/tests/01-run.py                     | 7 +++----
 tests/evtimer_msg/tests/01-run.py                | 7 +++----
 tests/evtimer_underflow/tests/01-run.py          | 7 +++----
 tests/float/tests/01-run.py                      | 7 +++----
 tests/fmt_print/tests/01-run.py                  | 7 +++----
 tests/gnrc_ipv6_ext/tests/01-run.py              | 7 +++----
 tests/gnrc_ipv6_nib/tests/01-run.py              | 7 +++----
 tests/gnrc_ipv6_nib_6ln/tests/01-run.py          | 7 +++----
 tests/gnrc_ndp/tests/01-run.py                   | 7 +++----
 tests/gnrc_netif/tests/01-run.py                 | 7 +++----
 tests/gnrc_sixlowpan/tests/01-run.py             | 7 +++----
 tests/gnrc_sock_ip/tests/01-run.py               | 7 +++----
 tests/gnrc_sock_udp/tests/01-run.py              | 7 +++----
 tests/irq/tests/01-run.py                        | 7 +++----
 tests/libfixmath/tests/01-run.py                 | 7 +++----
 tests/libfixmath_unittests/tests/01-run.py       | 7 +++----
 tests/lwip_sock_ip/tests/01-run.py               | 7 +++----
 tests/lwip_sock_tcp/tests/01-run.py              | 7 +++----
 tests/lwip_sock_udp/tests/01-run.py              | 7 +++----
 tests/msg_avail/tests/01-run.py                  | 7 +++----
 tests/msg_send_receive/tests/01-run.py           | 7 +++----
 tests/msg_try_receive/tests/01-run.py            | 7 +++----
 tests/mutex_order/tests/01-run.py                | 7 +++----
 tests/mutex_unlock_and_sleep/tests/01-run.py     | 7 +++----
 tests/netdev_test/tests/01-run.py                | 7 +++----
 tests/nhdp/tests/01-run.py                       | 7 +++----
 tests/od/tests/01-run.py                         | 7 +++----
 tests/od/tests/02-run.py                         | 7 +++----
 tests/periph_timer/tests/01-run.py               | 7 +++----
 tests/pipe/tests/01-run.py                       | 7 +++----
 tests/pkg_jsmn/tests/01-run.py                   | 7 +++----
 tests/pkg_libcoap/tests/01-run.py                | 7 +++----
 tests/pkg_micro-ecc-with-hwrng/tests/01-run.py   | 7 +++----
 tests/pkg_micro-ecc/tests/01-run.py              | 7 +++----
 tests/pkg_minmea/tests/01-run.py                 | 7 +++----
 tests/pkg_tiny-asn1/tests/01-run.py              | 7 +++----
 tests/pkg_umorse/tests/01-run.py                 | 7 +++----
 tests/posix_semaphore/tests/01-run.py            | 7 +++----
 tests/posix_time/tests/01-run.py                 | 7 +++----
 tests/ps_schedstatistics/tests/01-run.py         | 8 +++-----
 tests/pthread/tests/01-run.py                    | 8 +++-----
 tests/pthread_barrier/tests/01-run.py            | 7 +++----
 tests/pthread_cleanup/tests/01-run.py            | 7 +++----
 tests/pthread_condition_variable/tests/01-run.py | 7 +++----
 tests/pthread_cooperation/tests/01-run.py        | 7 +++----
 tests/pthread_rwlock/tests/01-run.py             | 7 +++----
 tests/pthread_tls/tests/01-run.py                | 7 +++----
 tests/rmutex/tests/01-run.py                     | 7 +++----
 tests/sched_testing/tests/01-run.py              | 7 +++----
 tests/shell/tests/01-run.py                      | 7 +++----
 tests/sizeof_tcb/tests/01-run.py                 | 7 +++----
 tests/ssp/tests/01-run.py                        | 7 +++----
 tests/struct_tm_utility/tests/01-run.py          | 7 +++----
 tests/thread_basic/tests/01-run.py               | 7 +++----
 tests/thread_cooperation/tests/01-run.py         | 7 +++----
 tests/thread_exit/tests/01-run.py                | 7 +++----
 tests/thread_flags/tests/01-run.py               | 7 +++----
 tests/thread_flags_xtimer/tests/01-run.py        | 7 +++----
 tests/thread_flood/tests/01-run.py               | 7 +++----
 tests/thread_msg/tests/01-run.py                 | 7 +++----
 tests/thread_msg_block_w_queue/tests/01-run.py   | 7 +++----
 tests/thread_msg_block_wo_queue/tests/01-run.py  | 7 +++----
 tests/thread_msg_seq/tests/01-run.py             | 7 +++----
 tests/trickle/tests/01-run.py                    | 7 +++----
 tests/unittests/tests/01-run.py                  | 7 +++----
 tests/xtimer_hang/tests/01-run.py                | 7 +++----
 tests/xtimer_msg_receive_timeout/tests/01-run.py | 7 +++----
 tests/xtimer_now64_continuity/tests/01-run.py    | 7 +++----
 tests/xtimer_periodic_wakeup/tests/01-run.py     | 7 +++----
 tests/xtimer_remove/tests/01-run.py              | 7 +++----
 tests/xtimer_reset/tests/01-run.py               | 7 +++----
 tests/xtimer_usleep/tests/01-run.py              | 7 +++----
 tests/xtimer_usleep_short/tests/01-run.py        | 7 +++----
 84 files changed, 252 insertions(+), 338 deletions(-)

diff --git a/tests/bitarithm_timings/tests/01-run.py b/tests/bitarithm_timings/tests/01-run.py
index bc8f4c236f..3178e94cfc 100755
--- a/tests/bitarithm_timings/tests/01-run.py
+++ b/tests/bitarithm_timings/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("Start.")
@@ -21,4 +18,6 @@ def testfunc(child):
     child.expect_exact("Done.")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc, timeout=30))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc, timeout=30))
diff --git a/tests/bloom_bytes/tests/01-run.py b/tests/bloom_bytes/tests/01-run.py
index 6585ca3487..de75b398f4 100755
--- a/tests/bloom_bytes/tests/01-run.py
+++ b/tests/bloom_bytes/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("Testing Bloom filter.")
@@ -24,4 +21,6 @@ def testfunc(child):
     child.expect_exact("All done!")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/buttons/tests/01-run.py b/tests/buttons/tests/01-run.py
index 6037857e9d..59437ecf37 100755
--- a/tests/buttons/tests/01-run.py
+++ b/tests/buttons/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("On-board button test")
@@ -24,4 +21,6 @@ def testfunc(child):
         child.expect_exact("[SUCCESS]")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/cbor/tests/01-run.py b/tests/cbor/tests/01-run.py
index c3ec006d31..68ec27daef 100755
--- a/tests/cbor/tests/01-run.py
+++ b/tests/cbor/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 ACCEPTED_ERROR = 20
 
 
@@ -52,4 +49,6 @@ def testfunc(child):
     print("All tests successful")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc, echo=False))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc, echo=False))
diff --git a/tests/cpp11_condition_variable/tests/01-run.py b/tests/cpp11_condition_variable/tests/01-run.py
index 5fde64fe27..c92f48c64f 100755
--- a/tests/cpp11_condition_variable/tests/01-run.py
+++ b/tests/cpp11_condition_variable/tests/01-run.py
@@ -10,9 +10,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("************ C++ condition_variable test ***********")
@@ -28,4 +25,6 @@ def testfunc(child):
     child.expect_exact("******************************************************")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/cpp11_mutex/tests/01-run.py b/tests/cpp11_mutex/tests/01-run.py
index 1646e6adf4..76bf11d9d7 100755
--- a/tests/cpp11_mutex/tests/01-run.py
+++ b/tests/cpp11_mutex/tests/01-run.py
@@ -10,9 +10,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("************ C++ mutex test ***********")
@@ -24,4 +21,6 @@ def testfunc(child):
     child.expect_exact("*****************************************")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/cpp11_thread/tests/01-run.py b/tests/cpp11_thread/tests/01-run.py
index 0307f92388..98b91d1d4e 100755
--- a/tests/cpp11_thread/tests/01-run.py
+++ b/tests/cpp11_thread/tests/01-run.py
@@ -10,9 +10,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("************ C++ thread test ***********")
@@ -36,4 +33,6 @@ def testfunc(child):
     child.expect_exact("******************************************")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/driver_ds1307/tests/01-run.py b/tests/driver_ds1307/tests/01-run.py
index 055199ef0f..b9d290dc4f 100755
--- a/tests/driver_ds1307/tests/01-run.py
+++ b/tests/driver_ds1307/tests/01-run.py
@@ -9,13 +9,12 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect([r"OK \([0-9]+ tests\)",
                   r"error: unable to initialize RTC \[I2C initialization error\]"])
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/driver_grove_ledbar/tests/01-run.py b/tests/driver_grove_ledbar/tests/01-run.py
index 3d121d9933..5b61fd1c99 100755
--- a/tests/driver_grove_ledbar/tests/01-run.py
+++ b/tests/driver_grove_ledbar/tests/01-run.py
@@ -10,12 +10,11 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact(u"[SUCCESS]", timeout=60)
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/driver_hd44780/tests/01-run.py b/tests/driver_hd44780/tests/01-run.py
index c3b9f15a90..234d38d8b6 100644
--- a/tests/driver_hd44780/tests/01-run.py
+++ b/tests/driver_hd44780/tests/01-run.py
@@ -10,13 +10,12 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("[START]")
     child.expect_exact("[SUCCESS]")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/driver_my9221/tests/01-run.py b/tests/driver_my9221/tests/01-run.py
index 7e48651f84..e5ee08c221 100755
--- a/tests/driver_my9221/tests/01-run.py
+++ b/tests/driver_my9221/tests/01-run.py
@@ -10,12 +10,11 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("[SUCCESS]", timeout=60)
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/events/tests/01-run.py b/tests/events/tests/01-run.py
index 2b3bd8b378..fab469c905 100755
--- a/tests/events/tests/01-run.py
+++ b/tests/events/tests/01-run.py
@@ -10,12 +10,11 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact(u"[SUCCESS]")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/evtimer_msg/tests/01-run.py b/tests/evtimer_msg/tests/01-run.py
index e3b400e39b..6f8c0eee46 100755
--- a/tests/evtimer_msg/tests/01-run.py
+++ b/tests/evtimer_msg/tests/01-run.py
@@ -10,9 +10,6 @@ from __future__ import print_function
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 ACCEPTED_ERROR = 20
 
 
@@ -32,4 +29,6 @@ def testfunc(child):
     print("All tests successful")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc, echo=False))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc, echo=False))
diff --git a/tests/evtimer_underflow/tests/01-run.py b/tests/evtimer_underflow/tests/01-run.py
index 926f6cee54..60efd4d8da 100755
--- a/tests/evtimer_underflow/tests/01-run.py
+++ b/tests/evtimer_underflow/tests/01-run.py
@@ -10,9 +10,6 @@ from __future__ import print_function
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 how_many = 100
 
 
@@ -26,4 +23,6 @@ def testfunc(child):
     print("=> All tests successful")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc, echo=False))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc, echo=False))
diff --git a/tests/float/tests/01-run.py b/tests/float/tests/01-run.py
index 38339e9492..0bef7e65cb 100755
--- a/tests/float/tests/01-run.py
+++ b/tests/float/tests/01-run.py
@@ -9,13 +9,12 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("Testing floating point arithmetics...")
     child.expect_exact("[SUCCESS]")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/fmt_print/tests/01-run.py b/tests/fmt_print/tests/01-run.py
index 7d6707a0f3..913500e1c7 100755
--- a/tests/fmt_print/tests/01-run.py
+++ b/tests/fmt_print/tests/01-run.py
@@ -3,13 +3,12 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact('If you can read this:')
     child.expect_exact('Test successful.')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/gnrc_ipv6_ext/tests/01-run.py b/tests/gnrc_ipv6_ext/tests/01-run.py
index 1db44826b7..3a56e803ba 100755
--- a/tests/gnrc_ipv6_ext/tests/01-run.py
+++ b/tests/gnrc_ipv6_ext/tests/01-run.py
@@ -10,9 +10,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     index = child.expect_exact([
@@ -41,4 +38,6 @@ def testfunc(child):
     child.expect_exact("pkt->users: 0")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/gnrc_ipv6_nib/tests/01-run.py b/tests/gnrc_ipv6_nib/tests/01-run.py
index d2ade821ec..741c695754 100755
--- a/tests/gnrc_ipv6_nib/tests/01-run.py
+++ b/tests/gnrc_ipv6_nib/tests/01-run.py
@@ -10,12 +10,11 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect(r"OK \(\d+ tests\)")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc, timeout=1))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/gnrc_ipv6_nib_6ln/tests/01-run.py b/tests/gnrc_ipv6_nib_6ln/tests/01-run.py
index d2ade821ec..741c695754 100755
--- a/tests/gnrc_ipv6_nib_6ln/tests/01-run.py
+++ b/tests/gnrc_ipv6_nib_6ln/tests/01-run.py
@@ -10,12 +10,11 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect(r"OK \(\d+ tests\)")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc, timeout=1))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/gnrc_ndp/tests/01-run.py b/tests/gnrc_ndp/tests/01-run.py
index 1f1039f78b..dcc3c5d7f6 100755
--- a/tests/gnrc_ndp/tests/01-run.py
+++ b/tests/gnrc_ndp/tests/01-run.py
@@ -10,13 +10,12 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     # 1st 6LoWPAN fragment
     child.expect(r"OK \(\d+ tests\)")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/gnrc_netif/tests/01-run.py b/tests/gnrc_netif/tests/01-run.py
index 255f8a5b4c..7901d4b7c0 100755
--- a/tests/gnrc_netif/tests/01-run.py
+++ b/tests/gnrc_netif/tests/01-run.py
@@ -10,9 +10,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     # embUnit tests
@@ -140,4 +137,6 @@ def testfunc(child):
     child.expect("~~ PKT    -  2 snips, total size:  61 byte")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc, timeout=1, traceback=True))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc, timeout=1, traceback=True))
diff --git a/tests/gnrc_sixlowpan/tests/01-run.py b/tests/gnrc_sixlowpan/tests/01-run.py
index a7d1842ceb..5138e34408 100755
--- a/tests/gnrc_sixlowpan/tests/01-run.py
+++ b/tests/gnrc_sixlowpan/tests/01-run.py
@@ -10,9 +10,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     # 1st 6LoWPAN fragment
@@ -78,4 +75,6 @@ def testfunc(child):
     child.expect_exact("destination address: fd01::1")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/gnrc_sock_ip/tests/01-run.py b/tests/gnrc_sock_ip/tests/01-run.py
index 0f5eea832e..dfe4e3077f 100755
--- a/tests/gnrc_sock_ip/tests/01-run.py
+++ b/tests/gnrc_sock_ip/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact(u"Calling test_sock_ip_create__EAFNOSUPPORT()")
@@ -51,4 +48,6 @@ def testfunc(child):
     child.expect_exact(u"ALL TESTS SUCCESSFUL")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/gnrc_sock_udp/tests/01-run.py b/tests/gnrc_sock_udp/tests/01-run.py
index f553d17c10..a91d62103f 100755
--- a/tests/gnrc_sock_udp/tests/01-run.py
+++ b/tests/gnrc_sock_udp/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact(u"Calling test_sock_udp_create__EADDRINUSE()")
@@ -55,4 +52,6 @@ def testfunc(child):
     child.expect_exact(u"ALL TESTS SUCCESSFUL")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/irq/tests/01-run.py b/tests/irq/tests/01-run.py
index 54be44a747..f5394a40b7 100755
--- a/tests/irq/tests/01-run.py
+++ b/tests/irq/tests/01-run.py
@@ -3,13 +3,12 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect('START')
     child.expect('SUCCESS')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/libfixmath/tests/01-run.py b/tests/libfixmath/tests/01-run.py
index 92e5f4544e..71916e93ea 100755
--- a/tests/libfixmath/tests/01-run.py
+++ b/tests/libfixmath/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def expect_unary(child):
     for _ in range(20):
@@ -41,4 +38,6 @@ def testfunc(child):
     child.expect_exact('SUCCESS')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/libfixmath_unittests/tests/01-run.py b/tests/libfixmath_unittests/tests/01-run.py
index 0a1cecc7d2..737987663f 100755
--- a/tests/libfixmath_unittests/tests/01-run.py
+++ b/tests/libfixmath_unittests/tests/01-run.py
@@ -9,12 +9,11 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect('SUCCESS')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/lwip_sock_ip/tests/01-run.py b/tests/lwip_sock_ip/tests/01-run.py
index 96f73bdd80..36cd5a0a83 100755
--- a/tests/lwip_sock_ip/tests/01-run.py
+++ b/tests/lwip_sock_ip/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def _ipv6_tests(code):
     return code & (1 << 6)
@@ -99,4 +96,6 @@ def testfunc(child):
     child.expect_exact(u"ALL TESTS SUCCESSFUL")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/lwip_sock_tcp/tests/01-run.py b/tests/lwip_sock_tcp/tests/01-run.py
index 176c998522..5ceb51e3e2 100755
--- a/tests/lwip_sock_tcp/tests/01-run.py
+++ b/tests/lwip_sock_tcp/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def _reuse_tests(code):
     return code & 1
@@ -93,4 +90,6 @@ def testfunc(child):
     child.expect_exact(u"ALL TESTS SUCCESSFUL")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc, timeout=60))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc, timeout=60))
diff --git a/tests/lwip_sock_udp/tests/01-run.py b/tests/lwip_sock_udp/tests/01-run.py
index ba0887ad2c..7cbc8007b3 100755
--- a/tests/lwip_sock_udp/tests/01-run.py
+++ b/tests/lwip_sock_udp/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def _reuse_tests(code):
     return code & 1
@@ -111,4 +108,6 @@ def testfunc(child):
     child.expect_exact(u"ALL TESTS SUCCESSFUL")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/msg_avail/tests/01-run.py b/tests/msg_avail/tests/01-run.py
index 2b3bd8b378..fab469c905 100755
--- a/tests/msg_avail/tests/01-run.py
+++ b/tests/msg_avail/tests/01-run.py
@@ -10,12 +10,11 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact(u"[SUCCESS]")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/msg_send_receive/tests/01-run.py b/tests/msg_send_receive/tests/01-run.py
index 9ff95cf953..26a28d1a2d 100755
--- a/tests/msg_send_receive/tests/01-run.py
+++ b/tests/msg_send_receive/tests/01-run.py
@@ -9,12 +9,11 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect(u"Test successful.")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/msg_try_receive/tests/01-run.py b/tests/msg_try_receive/tests/01-run.py
index 75c63e5653..d69458c3f6 100755
--- a/tests/msg_try_receive/tests/01-run.py
+++ b/tests/msg_try_receive/tests/01-run.py
@@ -3,13 +3,12 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect('main starting')
     child.expect('msg available: 1 \(should be 1\!\)')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/mutex_order/tests/01-run.py b/tests/mutex_order/tests/01-run.py
index 85e800f948..4dbeb32959 100755
--- a/tests/mutex_order/tests/01-run.py
+++ b/tests/mutex_order/tests/01-run.py
@@ -10,9 +10,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 thread_prio = {
         3:  6,
         4:  4,
@@ -33,4 +30,6 @@ def testfunc(child):
         last = int(child.match.group(1))
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/mutex_unlock_and_sleep/tests/01-run.py b/tests/mutex_unlock_and_sleep/tests/01-run.py
index eb74e3799a..632c66ab10 100755
--- a/tests/mutex_unlock_and_sleep/tests/01-run.py
+++ b/tests/mutex_unlock_and_sleep/tests/01-run.py
@@ -9,13 +9,12 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     for i in range(20):
         child.expect(r"\[ALIVE\] alternated \d+k times.")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/netdev_test/tests/01-run.py b/tests/netdev_test/tests/01-run.py
index 757c1bd24d..615046f432 100755
--- a/tests/netdev_test/tests/01-run.py
+++ b/tests/netdev_test/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact('Executing test_get_addr()')
@@ -25,4 +22,6 @@ def testfunc(child):
     child.expect_exact('ALL TESTS SUCCESSFUL')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/nhdp/tests/01-run.py b/tests/nhdp/tests/01-run.py
index ffbbecfe97..ee451a7d3c 100755
--- a/tests/nhdp/tests/01-run.py
+++ b/tests/nhdp/tests/01-run.py
@@ -9,12 +9,11 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact('SUCCESS: NHDP compiled!')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/od/tests/01-run.py b/tests/od/tests/01-run.py
index cb4e8f7f62..d99d4300ae 100755
--- a/tests/od/tests/01-run.py
+++ b/tests/od/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("od_hex_dump(short_str, sizeof(short_str), OD_WIDTH_DEFAULT)")
@@ -42,4 +39,6 @@ def testfunc(child):
     print("All tests successful")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc, timeout=1, echo=False))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc, timeout=1, echo=False))
diff --git a/tests/od/tests/02-run.py b/tests/od/tests/02-run.py
index 5d6c14abe8..3e99f59b9b 100755
--- a/tests/od/tests/02-run.py
+++ b/tests/od/tests/02-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("od_hex_dump(short_str, sizeof(short_str), OD_WIDTH_DEFAULT)")
@@ -42,4 +39,6 @@ def testfunc(child):
     print("All tests successful")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc, timeout=1, echo=False))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc, timeout=1, echo=False))
diff --git a/tests/periph_timer/tests/01-run.py b/tests/periph_timer/tests/01-run.py
index eca2be6353..5e6a8f7cd0 100755
--- a/tests/periph_timer/tests/01-run.py
+++ b/tests/periph_timer/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect('Available timers: (\d+)')
@@ -24,4 +21,6 @@ def testfunc(child):
     child.expect('TEST SUCCEEDED')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/pipe/tests/01-run.py b/tests/pipe/tests/01-run.py
index 1130f89c67..8965b5a720 100755
--- a/tests/pipe/tests/01-run.py
+++ b/tests/pipe/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact('Start.')
@@ -32,4 +29,6 @@ def testfunc(child):
     child.expect_exact('End done.')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/pkg_jsmn/tests/01-run.py b/tests/pkg_jsmn/tests/01-run.py
index c3f8a0f0b6..c5e46800e7 100755
--- a/tests/pkg_jsmn/tests/01-run.py
+++ b/tests/pkg_jsmn/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact('- User: johndoe')
@@ -18,4 +15,6 @@ def testfunc(child):
     child.expect_exact('  * video')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/pkg_libcoap/tests/01-run.py b/tests/pkg_libcoap/tests/01-run.py
index 361082affc..dd4a7748f4 100755
--- a/tests/pkg_libcoap/tests/01-run.py
+++ b/tests/pkg_libcoap/tests/01-run.py
@@ -3,12 +3,11 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact('SUCCESS: Libcoap compiled!')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/pkg_micro-ecc-with-hwrng/tests/01-run.py b/tests/pkg_micro-ecc-with-hwrng/tests/01-run.py
index 87ee4f1cf0..4118445bca 100755
--- a/tests/pkg_micro-ecc-with-hwrng/tests/01-run.py
+++ b/tests/pkg_micro-ecc-with-hwrng/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact('micro-ecc compiled!')
@@ -15,4 +12,6 @@ def testfunc(child):
     child.expect_exact('SUCCESS')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc, timeout=60))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc, timeout=60))
diff --git a/tests/pkg_micro-ecc/tests/01-run.py b/tests/pkg_micro-ecc/tests/01-run.py
index c03e53b7b7..513681ac13 100755
--- a/tests/pkg_micro-ecc/tests/01-run.py
+++ b/tests/pkg_micro-ecc/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact('micro-ecc compiled!')
@@ -15,4 +12,6 @@ def testfunc(child):
     child.expect_exact('SUCCESS')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc, timeout=60))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc, timeout=60))
diff --git a/tests/pkg_minmea/tests/01-run.py b/tests/pkg_minmea/tests/01-run.py
index e6aba51b00..dc6d8b5472 100755
--- a/tests/pkg_minmea/tests/01-run.py
+++ b/tests/pkg_minmea/tests/01-run.py
@@ -3,13 +3,12 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact('START')
     child.expect_exact('SUCCESS')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/pkg_tiny-asn1/tests/01-run.py b/tests/pkg_tiny-asn1/tests/01-run.py
index 0c25de9354..674ed5a8ed 100755
--- a/tests/pkg_tiny-asn1/tests/01-run.py
+++ b/tests/pkg_tiny-asn1/tests/01-run.py
@@ -10,12 +10,11 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect('Decoding finished succesfully')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/pkg_umorse/tests/01-run.py b/tests/pkg_umorse/tests/01-run.py
index 19c6dd918f..b3fe164f1e 100755
--- a/tests/pkg_umorse/tests/01-run.py
+++ b/tests/pkg_umorse/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect(u".... . ._.. ._.. ___ / ._. .. ___ _ ___ ...", timeout=30)
@@ -23,4 +20,6 @@ def testfunc(child):
     child.expect_exact("[SUCCESS]", timeout=120)
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/posix_semaphore/tests/01-run.py b/tests/posix_semaphore/tests/01-run.py
index 6e827717ba..cb5bf3a01b 100755
--- a/tests/posix_semaphore/tests/01-run.py
+++ b/tests/posix_semaphore/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def test1(term):
     term.expect_exact("######################### TEST1:")
@@ -100,4 +97,6 @@ def testfunc(child):
     child.expect("######################### DONE")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/posix_time/tests/01-run.py b/tests/posix_time/tests/01-run.py
index 036cf5026a..324ea3393d 100755
--- a/tests/posix_time/tests/01-run.py
+++ b/tests/posix_time/tests/01-run.py
@@ -12,9 +12,6 @@ import os
 import sys
 import time
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 US_PER_SEC = 1000000
 EXTERNAL_JITTER = 0.15
 
@@ -48,4 +45,6 @@ def testfunc(child):
         sys.exit(1)
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc, echo=True))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/ps_schedstatistics/tests/01-run.py b/tests/ps_schedstatistics/tests/01-run.py
index 3138b3dd09..5d76f3d608 100755
--- a/tests/ps_schedstatistics/tests/01-run.py
+++ b/tests/ps_schedstatistics/tests/01-run.py
@@ -9,10 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
-
 PS_EXPECTED = (
     ('\tpid | name                 | state    Q | pri | stack  ( used) | '
      'base addr  | current     | runtime  | switches'),
@@ -63,4 +59,6 @@ def testfunc(child):
     _check_ps(child)
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/pthread/tests/01-run.py b/tests/pthread/tests/01-run.py
index f2ae587229..7a28b9d681 100755
--- a/tests/pthread/tests/01-run.py
+++ b/tests/pthread/tests/01-run.py
@@ -4,10 +4,6 @@ import os
 import sys
 import math
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
-
 FACTORIAL_PARAM = 6
 
 
@@ -22,4 +18,6 @@ def testfunc(child):
 
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/pthread_barrier/tests/01-run.py b/tests/pthread_barrier/tests/01-run.py
index 9dcab9af75..197085bea3 100755
--- a/tests/pthread_barrier/tests/01-run.py
+++ b/tests/pthread_barrier/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect('START')
@@ -19,4 +16,6 @@ def testfunc(child):
 
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/pthread_cleanup/tests/01-run.py b/tests/pthread_cleanup/tests/01-run.py
index 91d45f5f41..5bf3a9e64b 100755
--- a/tests/pthread_cleanup/tests/01-run.py
+++ b/tests/pthread_cleanup/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect('START')
@@ -23,4 +20,6 @@ def testfunc(child):
 
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/pthread_condition_variable/tests/01-run.py b/tests/pthread_condition_variable/tests/01-run.py
index a88053e6fb..af8c007044 100755
--- a/tests/pthread_condition_variable/tests/01-run.py
+++ b/tests/pthread_condition_variable/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect('START')
@@ -16,4 +13,6 @@ def testfunc(child):
 if __name__ == "__main__":
     # This test can take some time to complete when testing on hardware (e.g
     # on samr21-xpro) and the default timeout (10s) is not enough.
-    sys.exit(testrunner.run(testfunc, timeout=60))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc, timeout=60))
diff --git a/tests/pthread_cooperation/tests/01-run.py b/tests/pthread_cooperation/tests/01-run.py
index 289259d3e1..a88a5975ce 100755
--- a/tests/pthread_cooperation/tests/01-run.py
+++ b/tests/pthread_cooperation/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect('START')
@@ -20,4 +17,6 @@ def testfunc(child):
 
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/pthread_rwlock/tests/01-run.py b/tests/pthread_rwlock/tests/01-run.py
index 260c449263..3dad83916d 100755
--- a/tests/pthread_rwlock/tests/01-run.py
+++ b/tests/pthread_rwlock/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect('START')
@@ -19,4 +16,6 @@ def testfunc(child):
 
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/pthread_tls/tests/01-run.py b/tests/pthread_tls/tests/01-run.py
index 12435e7b90..004395d4e0 100755
--- a/tests/pthread_tls/tests/01-run.py
+++ b/tests/pthread_tls/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def _check_test_output(child):
     child.expect('show tls values:')
@@ -38,4 +35,6 @@ def testfunc(child):
     child.expect('SUCCESS')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/rmutex/tests/01-run.py b/tests/rmutex/tests/01-run.py
index f9a86d1c60..a68a109ce7 100755
--- a/tests/rmutex/tests/01-run.py
+++ b/tests/rmutex/tests/01-run.py
@@ -11,9 +11,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 thread_prio = {
         3:  6,
         4:  4,
@@ -47,4 +44,6 @@ def testfunc(child):
                          (T, thread_prio[T], depth))
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/sched_testing/tests/01-run.py b/tests/sched_testing/tests/01-run.py
index 5adc760361..c383d79011 100755
--- a/tests/sched_testing/tests/01-run.py
+++ b/tests/sched_testing/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact('The output should be: yield 1, snd_thread running, '
@@ -18,4 +15,6 @@ def testfunc(child):
     child.expect_exact('done')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/shell/tests/01-run.py b/tests/shell/tests/01-run.py
index b255b8aa48..c2e309f654 100755
--- a/tests/shell/tests/01-run.py
+++ b/tests/shell/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 EXPECTED_HELP = (
     'Command              Description',
     '---------------------------------------',
@@ -58,4 +55,6 @@ def testfunc(child):
         check_cmd(child, cmd, expected)
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/sizeof_tcb/tests/01-run.py b/tests/sizeof_tcb/tests/01-run.py
index 5d568051f6..831ee218ac 100755
--- a/tests/sizeof_tcb/tests/01-run.py
+++ b/tests/sizeof_tcb/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact('\tmember, sizeof, offsetof')
@@ -28,4 +25,6 @@ def testfunc(child):
     child.expect_exact('SUCCESS')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/ssp/tests/01-run.py b/tests/ssp/tests/01-run.py
index 6de5ad7147..8b5334ff8a 100755
--- a/tests/ssp/tests/01-run.py
+++ b/tests/ssp/tests/01-run.py
@@ -9,13 +9,12 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact('calling stack corruption function')
     child.expect('.*stack smashing detected.*')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/struct_tm_utility/tests/01-run.py b/tests/struct_tm_utility/tests/01-run.py
index 078d4db9c4..91fa7fa489 100755
--- a/tests/struct_tm_utility/tests/01-run.py
+++ b/tests/struct_tm_utility/tests/01-run.py
@@ -11,9 +11,6 @@ import sys
 import calendar
 import datetime
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def _check_help(child):
     child.sendline('help')
@@ -116,4 +113,6 @@ def testfunc(child):
     _check_day(child)
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/thread_basic/tests/01-run.py b/tests/thread_basic/tests/01-run.py
index 5a7f5034b5..74e3fcd77a 100755
--- a/tests/thread_basic/tests/01-run.py
+++ b/tests/thread_basic/tests/01-run.py
@@ -9,13 +9,12 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect('first thread\r\n')
     child.expect('second thread\r\n')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/thread_cooperation/tests/01-run.py b/tests/thread_cooperation/tests/01-run.py
index 9b6ecbfbd1..84bcbbb0d9 100755
--- a/tests/thread_cooperation/tests/01-run.py
+++ b/tests/thread_cooperation/tests/01-run.py
@@ -10,9 +10,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect(r"MAIN: reply from T-\d+")
@@ -20,4 +17,6 @@ def testfunc(child):
     child.expect_exact("[SUCCESS]")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/thread_exit/tests/01-run.py b/tests/thread_exit/tests/01-run.py
index c3e6ce101a..dfc2c1136a 100755
--- a/tests/thread_exit/tests/01-run.py
+++ b/tests/thread_exit/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect("main: starting")
@@ -19,4 +16,6 @@ def testfunc(child):
 
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/thread_flags/tests/01-run.py b/tests/thread_flags/tests/01-run.py
index 7258ef4241..8b0b8f560e 100755
--- a/tests/thread_flags/tests/01-run.py
+++ b/tests/thread_flags/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect("START")
@@ -31,4 +28,6 @@ def testfunc(child):
 
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/thread_flags_xtimer/tests/01-run.py b/tests/thread_flags_xtimer/tests/01-run.py
index 9f2a5e8e0b..5f2c50d36b 100755
--- a/tests/thread_flags_xtimer/tests/01-run.py
+++ b/tests/thread_flags_xtimer/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect("START")
@@ -15,4 +12,6 @@ def testfunc(child):
 
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/thread_flood/tests/01-run.py b/tests/thread_flood/tests/01-run.py
index 4cc744e010..7e7cb55860 100755
--- a/tests/thread_flood/tests/01-run.py
+++ b/tests/thread_flood/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact(u'[START] Spawning threads')
@@ -13,4 +10,6 @@ def testfunc(child):
     child.expect(r'\[SUCCESS\] created \d+')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/thread_msg/tests/01-run.py b/tests/thread_msg/tests/01-run.py
index f09411b81c..57d9f326e5 100755
--- a/tests/thread_msg/tests/01-run.py
+++ b/tests/thread_msg/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact('THREADS CREATED')
@@ -16,4 +13,6 @@ def testfunc(child):
     child.expect_exact('SUCCESS')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/thread_msg_block_w_queue/tests/01-run.py b/tests/thread_msg_block_w_queue/tests/01-run.py
index 0a9a8ee4bd..3ab9705cbf 100755
--- a/tests/thread_msg_block_w_queue/tests/01-run.py
+++ b/tests/thread_msg_block_w_queue/tests/01-run.py
@@ -9,13 +9,12 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect('sender_thread start\r\n')
     child.expect('main thread alive\r\n')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/thread_msg_block_wo_queue/tests/01-run.py b/tests/thread_msg_block_wo_queue/tests/01-run.py
index 0a9a8ee4bd..3ab9705cbf 100755
--- a/tests/thread_msg_block_wo_queue/tests/01-run.py
+++ b/tests/thread_msg_block_wo_queue/tests/01-run.py
@@ -9,13 +9,12 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect('sender_thread start\r\n')
     child.expect('main thread alive\r\n')
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/thread_msg_seq/tests/01-run.py b/tests/thread_msg_seq/tests/01-run.py
index b1e52cfd93..7f099853d4 100755
--- a/tests/thread_msg_seq/tests/01-run.py
+++ b/tests/thread_msg_seq/tests/01-run.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect("START")
@@ -23,4 +20,6 @@ def testfunc(child):
 
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/trickle/tests/01-run.py b/tests/trickle/tests/01-run.py
index 33ad94d772..47afeebe73 100755
--- a/tests/trickle/tests/01-run.py
+++ b/tests/trickle/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("[START]")
@@ -27,4 +24,6 @@ def testfunc(child):
     child.expect_exact("[SUCCESS]")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/unittests/tests/01-run.py b/tests/unittests/tests/01-run.py
index c8183c2a4f..48b7ac912e 100755
--- a/tests/unittests/tests/01-run.py
+++ b/tests/unittests/tests/01-run.py
@@ -9,12 +9,11 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect(u"OK \\([0-9]+ tests\\)")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc, timeout=60))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc, timeout=60))
diff --git a/tests/xtimer_hang/tests/01-run.py b/tests/xtimer_hang/tests/01-run.py
index cc44b205af..68676388e2 100755
--- a/tests/xtimer_hang/tests/01-run.py
+++ b/tests/xtimer_hang/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("[START]")
@@ -24,4 +21,6 @@ def testfunc(child):
     child.expect_exact("[SUCCESS]")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/xtimer_msg_receive_timeout/tests/01-run.py b/tests/xtimer_msg_receive_timeout/tests/01-run.py
index 5cfc83c7a5..2de740b507 100755
--- a/tests/xtimer_msg_receive_timeout/tests/01-run.py
+++ b/tests/xtimer_msg_receive_timeout/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect("[START]")
@@ -21,4 +18,6 @@ def testfunc(child):
     child.expect("[SUCCESS]")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/xtimer_now64_continuity/tests/01-run.py b/tests/xtimer_now64_continuity/tests/01-run.py
index 828efb6606..471c537dab 100755
--- a/tests/xtimer_now64_continuity/tests/01-run.py
+++ b/tests/xtimer_now64_continuity/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("[START]")
@@ -19,4 +16,6 @@ def testfunc(child):
     child.expect_exact("[SUCCESS]")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/xtimer_periodic_wakeup/tests/01-run.py b/tests/xtimer_periodic_wakeup/tests/01-run.py
index 433ce16241..6012617a75 100755
--- a/tests/xtimer_periodic_wakeup/tests/01-run.py
+++ b/tests/xtimer_periodic_wakeup/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("xtimer_periodic_wakeup test application.")
@@ -25,4 +22,6 @@ def testfunc(child):
     child.expect_exact("Test complete.")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/xtimer_remove/tests/01-run.py b/tests/xtimer_remove/tests/01-run.py
index 8b7c527066..56dfa19f28 100755
--- a/tests/xtimer_remove/tests/01-run.py
+++ b/tests/xtimer_remove/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("xtimer_remove test application.")
@@ -27,4 +24,6 @@ def testfunc(child):
     child.expect_exact("test successful.")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/xtimer_reset/tests/01-run.py b/tests/xtimer_reset/tests/01-run.py
index 87f31a0b89..11af527564 100755
--- a/tests/xtimer_reset/tests/01-run.py
+++ b/tests/xtimer_reset/tests/01-run.py
@@ -9,9 +9,6 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect_exact("This test tests re-setting of an already active timer.")
@@ -23,4 +20,6 @@ def testfunc(child):
     child.expect_exact("Test completed!")
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/xtimer_usleep/tests/01-run.py b/tests/xtimer_usleep/tests/01-run.py
index 3e41763a11..01c5fc6c3b 100755
--- a/tests/xtimer_usleep/tests/01-run.py
+++ b/tests/xtimer_usleep/tests/01-run.py
@@ -13,9 +13,6 @@ import os
 import sys
 import time
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 US_PER_SEC = 1000000
 INTERNAL_JITTER = 0.05
 EXTERNAL_JITTER = 0.15
@@ -55,4 +52,6 @@ def testfunc(child):
         sys.exit(1)
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc, echo=True))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
diff --git a/tests/xtimer_usleep_short/tests/01-run.py b/tests/xtimer_usleep_short/tests/01-run.py
index 5fc2385ef5..fb43acd748 100755
--- a/tests/xtimer_usleep_short/tests/01-run.py
+++ b/tests/xtimer_usleep_short/tests/01-run.py
@@ -10,9 +10,6 @@ import os
 import sys
 import pexpect
 
-sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
-import testrunner
-
 
 def testfunc(child):
     child.expect(u"This test will call xtimer_usleep for values from \\d+ down to \\d+\r\n")
@@ -31,4 +28,6 @@ def testfunc(child):
     child.expect(u"[SUCCESS]", timeout=3)
 
 if __name__ == "__main__":
-    sys.exit(testrunner.run(testfunc))
+    sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+    from testrunner import run
+    sys.exit(run(testfunc))
-- 
GitLab