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
f483df54
Commit
f483df54
authored
Jul 26, 2012
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update test_patched_xxx.py to chdir to /tmp/ and copy necessary assets there (like .pem files)
parent
f30e5294
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
39 additions
and
48 deletions
+39
-48
greentest/helper.py
greentest/helper.py
+19
-2
greentest/test_patched_asyncore.py
greentest/test_patched_asyncore.py
+1
-1
greentest/test_patched_ftplib.py
greentest/test_patched_ftplib.py
+1
-1
greentest/test_patched_httplib.py
greentest/test_patched_httplib.py
+1
-1
greentest/test_patched_httpservers.py
greentest/test_patched_httpservers.py
+1
-1
greentest/test_patched_queue.py
greentest/test_patched_queue.py
+1
-1
greentest/test_patched_select.py
greentest/test_patched_select.py
+1
-1
greentest/test_patched_signal.py
greentest/test_patched_signal.py
+1
-1
greentest/test_patched_smtplib.py
greentest/test_patched_smtplib.py
+1
-1
greentest/test_patched_socket.py
greentest/test_patched_socket.py
+1
-1
greentest/test_patched_socket_ssl.py
greentest/test_patched_socket_ssl.py
+1
-1
greentest/test_patched_ssl.py
greentest/test_patched_ssl.py
+1
-1
greentest/test_patched_subprocess.py
greentest/test_patched_subprocess.py
+0
-7
greentest/test_patched_telnetlib.py
greentest/test_patched_telnetlib.py
+1
-1
greentest/test_patched_threading.py
greentest/test_patched_threading.py
+1
-20
greentest/test_patched_threading_local.py
greentest/test_patched_threading_local.py
+1
-1
greentest/test_patched_timeout.py
greentest/test_patched_timeout.py
+1
-1
greentest/test_patched_urllib.py
greentest/test_patched_urllib.py
+1
-1
greentest/test_patched_urllib2.py
greentest/test_patched_urllib2.py
+1
-1
greentest/test_patched_urllib2_localnet.py
greentest/test_patched_urllib2_localnet.py
+1
-1
greentest/test_patched_urllib2net.py
greentest/test_patched_urllib2net.py
+1
-1
greentest/test_patched_wsgiref.py
greentest/test_patched_wsgiref.py
+1
-1
No files found.
greentest/helper.py
View file @
f483df54
import
sys
import
os
import
imp
import
tempfile
import
glob
from
pipes
import
quote
version
=
'%s.%s'
%
sys
.
version_info
[:
2
]
...
...
@@ -81,6 +84,20 @@ def prepare_stdlib_test(filename):
return
_prepare_stdlib_test
(
filename
)[
0
]
def
run
(
filename
,
globals
):
def
run
(
filename
,
d
,
assets
=
None
):
module_code
,
filename
=
_prepare_stdlib_test
(
filename
)
exec
module_code
in
globals
chdir
=
os
.
path
.
join
(
tempfile
.
gettempdir
(),
'gevent-test'
)
try
:
os
.
makedirs
(
chdir
)
except
EnvironmentError
:
pass
if
assets
:
directory
=
os
.
path
.
dirname
(
filename
)
os
.
chdir
(
directory
)
if
isinstance
(
assets
,
basestring
):
assets
=
glob
.
glob
(
assets
)
for
asset
in
assets
:
os
.
system
(
'cp -r %s %s'
%
(
quote
(
asset
),
quote
(
os
.
path
.
join
(
chdir
,
asset
))))
os
.
chdir
(
chdir
)
exec
module_code
in
d
greentest/test_patched_asyncore.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_ftplib.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_httplib.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_httpservers.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_queue.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_select.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_signal.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_smtplib.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_socket.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_socket_ssl.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_ssl.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
(),
'*.pem'
)
greentest/test_patched_subprocess.py
View file @
f483df54
import
os
import
glob
import
helper
before
=
set
(
glob
.
glob
(
'@test_*_tmp'
))
helper
.
run
(
__file__
,
globals
())
for
filename
in
set
(
glob
.
glob
(
'@test_*_tmp'
))
-
before
:
os
.
unlink
(
filename
)
import
subprocess
assert
'gevent'
in
repr
(
subprocess
.
Popen
.
__init__
.
im_func
.
func_code
),
repr
(
subprocess
.
Popen
.
__init__
.
im_func
.
func_code
)
greentest/test_patched_telnetlib.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_threading.py
View file @
f483df54
import
helper
module
=
helper
.
prepare_stdlib_test
(
__file__
)
import
sys
import
subprocess
from
subprocess
import
Popen
as
_Popen
monkey_patch
=
'from gevent import monkey; monkey.patch_all()
\
n
\
n
'
class
MyPopen
(
_Popen
):
def
__init__
(
self
,
arg
,
*
args
,
**
kwargs
):
if
arg
[:
2
]
==
[
sys
.
executable
,
'-c'
]:
assert
len
(
arg
)
==
3
,
arg
arg
=
arg
[:
2
]
+
[
monkey_patch
+
arg
[
2
]]
_Popen
.
__init__
(
self
,
arg
,
*
args
,
**
kwargs
)
subprocess
.
Popen
=
MyPopen
exec
module
in
globals
()
helper
.
run
(
__file__
,
globals
())
greentest/test_patched_threading_local.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_timeout.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_urllib.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_urllib2.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_urllib2_localnet.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_urllib2net.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
greentest/test_patched_wsgiref.py
View file @
f483df54
import
helper
exec
helper
.
prepare_stdlib_test
(
__file__
)
in
globals
(
)
helper
.
run
(
__file__
,
globals
()
)
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