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
dc43d5b8
Commit
dc43d5b8
authored
Jan 29, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup greentest
parent
0ee9d384
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
42 deletions
+0
-42
greentest/greentest.py
greentest/greentest.py
+0
-42
No files found.
greentest/greentest.py
View file @
dc43d5b8
...
...
@@ -171,45 +171,3 @@ class GenericGetTestCase(TestCase):
delay
=
time
.
time
()
-
start
assert
0.01
-
0.001
<=
delay
<
0.01
+
0.01
+
0.1
,
delay
def
patch_all
(
timeout
=
None
):
from
gevent
import
monkey
monkey
.
patch_all
(
aggressive
=
True
)
import
unittest
unittest
.
TestCase
=
TestCase
if
timeout
is
not
None
:
TestCase
.
__timeout__
=
timeout
class
ContainsAll
(
object
):
def
__contains__
(
self
,
item
):
return
True
def
prepare_stdlib_test
(
filename
):
from
test
import
test_support
test_support
.
use_resources
=
ContainsAll
()
name
=
filename
.
replace
(
'_patched'
,
''
).
replace
(
'.py'
,
''
)
os
.
environ
[
'__module_name__'
]
=
name
try
:
# XXX importing just to find where it resides; need a function that just returns the path
package
=
__import__
(
'test.%s'
%
name
)
except
:
print
>>
sys
.
stderr
,
'ModuleNotFoundWarning: cannot import test.%s'
%
name
sys
.
exit
(
0
)
module
=
getattr
(
package
,
name
)
_filename
=
module
.
__file__
.
replace
(
'.pyc'
,
'.py'
)
module_source
=
open
(
_filename
).
read
()
from
patched_tests_setup
import
disable_tests_in_the_source
module_source
=
disable_tests_in_the_source
(
module_source
,
name
)
module_code
=
compile
(
module_source
,
_filename
,
'exec'
)
print
>>
sys
.
stderr
,
'Testing %s with monkey patching'
%
_filename
patch_all
(
timeout
=
20
)
return
module_code
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