Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
25379ae4
Commit
25379ae4
authored
May 04, 2012
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testrunner.py: unless --db option is provided, create sqlite db in /tmp/ and remove it every time
parent
ea525bce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
greentest/testrunner.py
greentest/testrunner.py
+16
-11
No files found.
greentest/testrunner.py
View file @
25379ae4
...
...
@@ -33,6 +33,8 @@ one will be selected if not provided.
# Known issues:
# - screws up warnings location, causing them to appear as originated from testrunner.py
DEFAULT_FILENAME
=
'/tmp/gevent-testrunner.sqlite3'
# the number of seconds each test script is allowed to run
DEFAULT_TIMEOUT
=
60
...
...
@@ -196,16 +198,6 @@ def get_core_version():
return
core
.
get_version
()
def
get_tempnam
():
import
warnings
warnings
.
filterwarnings
(
'ignore'
,
'tempnam is a potential security risk to your program'
)
try
:
tempnam
=
os
.
tempnam
()
finally
:
del
warnings
.
filters
[
0
]
return
os
.
path
.
join
(
os
.
path
.
dirname
(
tempnam
),
'testresults.sqlite3'
)
def
execfile_as_main
(
path
):
import
__builtin__
oldmain
=
sys
.
modules
[
"__main__"
]
...
...
@@ -559,13 +551,22 @@ def print_stats(options):
return
False
def
unlink
(
path
):
try
:
os
.
unlink
(
path
)
except
OSError
,
ex
:
if
ex
.
errno
==
2
:
# No such file or directory
return
raise
def
main
():
import
optparse
parser
=
optparse
.
OptionParser
()
parser
.
add_option
(
'-v'
,
'--verbose'
,
default
=
0
,
action
=
'count'
)
parser
.
add_option
(
'-q'
,
'--quiet'
,
default
=
0
,
action
=
'count'
)
parser
.
add_option
(
'--verbosity'
,
default
=
0
,
type
=
'int'
,
help
=
optparse
.
SUPPRESS_HELP
)
parser
.
add_option
(
'--db'
,
default
=
'testresults.sqlite3'
)
parser
.
add_option
(
'--db'
)
parser
.
add_option
(
'--no-db'
,
dest
=
'db'
,
action
=
'store_false'
)
parser
.
add_option
(
'--runid'
)
parser
.
add_option
(
'--record'
,
default
=
False
,
action
=
'store_true'
)
...
...
@@ -576,6 +577,10 @@ def main():
options
,
args
=
parser
.
parse_args
()
options
.
verbosity
+=
options
.
verbose
-
options
.
quiet
if
options
.
db
is
None
:
unlink
(
DEFAULT_FILENAME
)
options
.
db
=
DEFAULT_FILENAME
if
options
.
db
:
if
sqlite3
:
options
.
db
=
os
.
path
.
abspath
(
options
.
db
)
...
...
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