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
da1b41af
Commit
da1b41af
authored
Aug 11, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First attempt to workaround Python 2 errors on Travis with TestGeventOrg.
parent
3d84f82a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
greentest/test__socket_dns.py
greentest/test__socket_dns.py
+16
-3
No files found.
greentest/test__socket_dns.py
View file @
da1b41af
...
...
@@ -228,12 +228,19 @@ class TestCase(greentest.TestCase):
return gevent_result
def _normalize_result(self, result):
return result
def assertEqualResults(self, real_result, gevent_result, func, args):
errors =
[socket.gaierror, socket.herror, TypeError]
if
type(real_result) in errors and type(gevent_result) in errors
:
errors =
(socket.gaierror, socket.herror, TypeError)
if
isinstance(real_result, errors) and isinstance(gevent_result, errors)
:
if type(real_result) is not type(gevent_result):
log('
WARNING
:
error
type
mismatch
:
%
r
(
gevent
)
!=
%
r
(
stdlib
)
', gevent_result, real_result)
return
real_result = self._normalize_result(real_result)
gevent_result = self._normalize_result(gevent_result)
real_result_repr = repr(real_result)
gevent_result_repr = repr(gevent_result)
if real_result_repr == gevent_result_repr:
...
...
@@ -311,7 +318,13 @@ for ip, host in re.findall(r'^\s*(\d+\.\d+\.\d+\.\d+)\s+([^\s]+)', etc_hosts, re
class TestGeventOrg(TestCase):
pass
def _normalize_result(self, result):
if isinstance(result, (list, tuple)):
# Attempt to account for round-robin DNS responses
# that return the same results in different orders
result = sorted(result)
return result
add(TestGeventOrg, '
gevent
.
org
')
...
...
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