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
f1399ac5
Commit
f1399ac5
authored
Oct 22, 2016
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Appease the leakchecker.
parent
78558892
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
20 deletions
+18
-20
src/greentest/test__greenlet.py
src/greentest/test__greenlet.py
+2
-2
src/greentest/test__subprocess.py
src/greentest/test__subprocess.py
+16
-18
No files found.
src/greentest/test__greenlet.py
View file @
f1399ac5
...
...
@@ -506,7 +506,7 @@ class TestBasic(greentest.TestCase):
return
return_value
g
=
gevent
.
Greenlet
(
func
,
0.01
,
return_value
=
5
)
g
.
rawlink
(
link_test
.
append
)
# use rawlink to avoid timing issues on Appveyor (not always successful)
g
.
rawlink
(
link_test
.
append
)
# use rawlink to avoid timing issues on Appveyor
/Travis
(not always successful)
assert
not
g
,
bool
(
g
)
assert
not
g
.
dead
assert
not
g
.
started
...
...
@@ -542,7 +542,7 @@ class TestBasic(greentest.TestCase):
assert
g
.
successful
()
assert
g
.
value
==
5
assert
g
.
exception
is
None
# not changed
assert
link_test
==
[
g
]
or
greentest
.
RUNNING_ON_
APPVEYOR
,
link_test
# changed
assert
link_test
==
[
g
]
or
greentest
.
RUNNING_ON_
CI
,
link_test
# changed
def
test_error_exit
(
self
):
link_test
=
[]
...
...
src/greentest/test__subprocess.py
View file @
f1399ac5
...
...
@@ -277,14 +277,13 @@ class RunFuncTestCase(greentest.TestCase):
def
test_check_output_stdin_arg
(
self
):
# run() can be called with stdin set to a file
tf
=
tempfile
.
TemporaryFile
()
self
.
addCleanup
(
tf
.
close
)
tf
.
write
(
b'pear'
)
tf
.
seek
(
0
)
cp
=
self
.
run_python
(
"import sys; sys.stdout.write(sys.stdin.read().upper())"
,
stdin
=
tf
,
stdout
=
subprocess
.
PIPE
)
self
.
assertIn
(
b'PEAR'
,
cp
.
stdout
)
with
tempfile
.
TemporaryFile
()
as
tf
:
tf
.
write
(
b'pear'
)
tf
.
seek
(
0
)
cp
=
self
.
run_python
(
"import sys; sys.stdout.write(sys.stdin.read().upper())"
,
stdin
=
tf
,
stdout
=
subprocess
.
PIPE
)
self
.
assertIn
(
b'PEAR'
,
cp
.
stdout
)
def
test_check_output_input_arg
(
self
):
# check_output() can be called with input set to a string
...
...
@@ -295,16 +294,15 @@ class RunFuncTestCase(greentest.TestCase):
def
test_check_output_stdin_with_input_arg
(
self
):
# run() refuses to accept 'stdin' with 'input'
tf
=
tempfile
.
TemporaryFile
()
self
.
addCleanup
(
tf
.
close
)
tf
.
write
(
b'pear'
)
tf
.
seek
(
0
)
with
self
.
assertRaises
(
ValueError
,
msg
=
"Expected ValueError when stdin and input args supplied."
)
as
c
:
self
.
run_python
(
"print('will not be run')"
,
stdin
=
tf
,
input
=
b'hare'
)
self
.
assertIn
(
'stdin'
,
c
.
exception
.
args
[
0
])
self
.
assertIn
(
'input'
,
c
.
exception
.
args
[
0
])
with
tempfile
.
TemporaryFile
()
as
tf
:
tf
.
write
(
b'pear'
)
tf
.
seek
(
0
)
with
self
.
assertRaises
(
ValueError
,
msg
=
"Expected ValueError when stdin and input args supplied."
)
as
c
:
self
.
run_python
(
"print('will not be run')"
,
stdin
=
tf
,
input
=
b'hare'
)
self
.
assertIn
(
'stdin'
,
c
.
exception
.
args
[
0
])
self
.
assertIn
(
'input'
,
c
.
exception
.
args
[
0
])
def
test_check_output_timeout
(
self
):
with
self
.
assertRaises
(
subprocess
.
TimeoutExpired
)
as
c
:
...
...
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