@@ -1,37 +1,38 @@
11# -*- coding: utf-8 -*-
2+# SPDX-License-Identifier: AGPL-3.0-or-later
23"""Shared testing code."""
34
5+# pylint: disable=missing-function-docstring
46
57import os
68import subprocess
79import traceback
810
9−from os.path import dirname, join, abspath
11+from os.path import dirname, join, abspath, realpath
1012
1113from splinter import Browser
1214from unittest2 import TestCase
1315
14−
1516class SearxTestLayer:
1617 """Base layer for non-robot tests."""
1718
1819 __name__ = u'SearxTestLayer'
1920
21+ @classmethod
2022 def setUp(cls):
2123 pass
22− setUp = classmethod(setUp)
2324
25+ @classmethod
2426 def tearDown(cls):
2527 pass
26− tearDown = classmethod(tearDown)
2728
29+ @classmethod
2830 def testSetUp(cls):
2931 pass
30− testSetUp = classmethod(testSetUp)
3132
33+ @classmethod
3234 def testTearDown(cls):
3335 pass
34− testTearDown = classmethod(testTearDown)
3536
3637
3738class SearxRobotLayer():
@@ -41,10 +42,7 @@ class SearxRobotLayer():
4142 os.setpgrp() # create new process group, become its leader
4243
4344 # get program paths
44− webapp = os.path.join(
45− os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
46− 'webapp.py'
47− )
45+ webapp = join(abspath(dirname(realpath(__file__))), 'webapp.py')
4846 exe = 'python'
4947
5048 # set robot settings path
@@ -105,7 +103,7 @@ if __name__ == '__main__':
105103 try:
106104 test_layer.setUp()
107105 run_robot_tests([getattr(robot, x) for x in dir(robot) if x.startswith('test_')])
108− except Exception:
106+ except Exception: # pylint: disable=broad-except
109107 errors = True
110108 print('Error occured: {0}'.format(traceback.format_exc()))
111109 test_layer.tearDown()