diff --git a/test/test_codebook_to_pdf.py b/test/test_codebook_to_pdf.py
index 4d2b8c49ed27943ec4d994bca49e15c5aca3bb96..155d8feaa12a33fab34e56c6f825ad878db7466f 100644
--- a/test/test_codebook_to_pdf.py
+++ b/test/test_codebook_to_pdf.py
@@ -1,7 +1,6 @@
 """Test exporting codebook to PDF."""
 import unittest
 import os
-from functools import partial
 from pathlib import Path
 from datetime import datetime
 from soitool import codebook_to_pdf
diff --git a/test/test_serialize_export_import.py b/test/test_serialize_export_import.py
index 563c70e36c0b8f2cdde62cb932f3e3c54c18a1c2..b0b1110ac4f9144c3635cf44f30bdbce9ad8a2c2 100644
--- a/test/test_serialize_export_import.py
+++ b/test/test_serialize_export_import.py
@@ -6,7 +6,6 @@ from pathlib import Path
 from datetime import datetime
 from schema import Schema, And, Or
 from PySide2.QtWidgets import QApplication
-from PySide2 import QtGui
 from soitool.soi import SOI
 from soitool.modules.module_table import TableModule
 from soitool.serialize_export_import_soi import (
@@ -15,10 +14,9 @@ from soitool.serialize_export_import_soi import (
     import_soi,
 )
 
-if isinstance(QtGui.qApp, type(None)):
+app = QApplication.instance()
+if app is None:
     app = QApplication([])
-else:
-    app = QtGui.qApp
 
 SOITOOL_ROOT_PATH = Path(__file__).parent.parent