Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
searx-engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
searx-engine
Commits
4a94b4cc
Commit
4a94b4cc
authored
Feb 23, 2020
by
Markus Heiser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
searx/testing.py: pylint & SPDX tag (no functional change)
Signed-off-by:
Markus Heiser
<
markus.heiser@darmarit.de
>
parent
1cae4fa8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
Makefile
Makefile
+1
-0
testing.py
searx/testing.py
+9
-11
No files found.
Makefile
View file @
4a94b4cc
...
...
@@ -77,6 +77,7 @@ test: test.pylint test.pep8 test.unit test.robot
# TODO: balance linting with pylint
test.pylint
:
pylint-exe
$
(
call cmd,pylint,searx/preferences.py
)
$
(
call cmd,pylint,searx/testing.py
)
test.pep8
:
pyenvinstall
$(PY_ENV_ACT)
;
./manage.sh pep8_check
...
...
searx/testing.py
View file @
4a94b4cc
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Shared testing code."""
# pylint: disable=missing-function-docstring
import
os
import
subprocess
import
traceback
from
os.path
import
dirname
,
join
,
abspath
from
os.path
import
dirname
,
join
,
abspath
,
realpath
from
splinter
import
Browser
from
unittest2
import
TestCase
class
SearxTestLayer
:
"""Base layer for non-robot tests."""
__name__
=
u'SearxTestLayer'
@
classmethod
def
setUp
(
cls
):
pass
setUp
=
classmethod
(
setUp
)
@
classmethod
def
tearDown
(
cls
):
pass
tearDown
=
classmethod
(
tearDown
)
@
classmethod
def
testSetUp
(
cls
):
pass
testSetUp
=
classmethod
(
testSetUp
)
@
classmethod
def
testTearDown
(
cls
):
pass
testTearDown
=
classmethod
(
testTearDown
)
class
SearxRobotLayer
():
...
...
@@ -41,10 +42,7 @@ class SearxRobotLayer():
os
.
setpgrp
()
# create new process group, become its leader
# get program paths
webapp
=
os
.
path
.
join
(
os
.
path
.
abspath
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))),
'webapp.py'
)
webapp
=
join
(
abspath
(
dirname
(
realpath
(
__file__
))),
'webapp.py'
)
exe
=
'python'
# set robot settings path
...
...
@@ -105,7 +103,7 @@ if __name__ == '__main__':
try
:
test_layer
.
setUp
()
run_robot_tests
([
getattr
(
robot
,
x
)
for
x
in
dir
(
robot
)
if
x
.
startswith
(
'test_'
)])
except
Exception
:
except
Exception
:
# pylint: disable=broad-except
errors
=
True
print
(
'Error occured: {0}'
.
format
(
traceback
.
format_exc
()))
test_layer
.
tearDown
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment