diff --git a/plinth/tests/__init__.py b/plinth/tests/__init__.py
index e69de29bb..656350883 100644
--- a/plinth/tests/__init__.py
+++ b/plinth/tests/__init__.py
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+#
+# This file is part of Plinth.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+
+"""
+Module initializer for Plinth test cases containing test suite
+"""
+
+import unittest
+
+
+TEST_SUITE = unittest.defaultTestLoader.discover('plinth.tests')
diff --git a/setup.py b/setup.py
index c724f32ae..d75d0d041 100755
--- a/setup.py
+++ b/setup.py
@@ -68,6 +68,7 @@ setup(
url='http://freedomboxfoundation.org',
packages=find_packages(),
scripts=['bin/plinth'],
+ test_suite='plinth.tests.TEST_SUITE',
license='COPYING',
classifiers=[
'Development Status :: 3 - Alpha',
diff --git a/test b/test
deleted file mode 100755
index 47a9728fd..000000000
--- a/test
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/python
-#
-# This file is part of Plinth.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-
-"""
-Script to run Plinth test cases
-"""
-
-import unittest
-
-
-if __name__ == '__main__':
- test_suite = unittest.defaultTestLoader.discover('plinth.tests')
- unittest.TextTestRunner().run(test_suite)