-sys.path.insert(1, bt_lib_py_path)
-sys.path.insert(2, bt_lib_bt_path)
-sys.path.insert(3, bt_lib_ctf_path)
+
+# Manually load the shared libraries used by the Babeltrace module during the
+# tests
+bt_lib_ctf_path = '@abs_top_builddir@/formats/ctf/.libs/libbabeltrace-ctf.so'
+bt_lib_bt_path = '@abs_top_builddir@/lib/.libs/libbabeltrace.so'
+
+ctypes.cdll.LoadLibrary(bt_lib_ctf_path)
+ctypes.cdll.LoadLibrary(bt_lib_bt_path)