Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
845f1526
Commit
845f1526
authored
May 08, 2011
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor buggy test to correctly use the msg argument of assertRaises.
parent
43432b84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
Lib/test/test_socket.py
Lib/test/test_socket.py
+4
-9
No files found.
Lib/test/test_socket.py
View file @
845f1526
...
@@ -270,18 +270,13 @@ class GeneralModuleTests(unittest.TestCase):
...
@@ -270,18 +270,13 @@ class GeneralModuleTests(unittest.TestCase):
def
testSocketError
(
self
):
def
testSocketError
(
self
):
# Testing socket module exceptions
# Testing socket module exceptions
def
raise_error
(
*
args
,
**
kwargs
):
msg
=
"Error raising socket exception (%s)."
with
self
.
assertRaises
(
socket
.
error
,
msg
=
msg
%
'socket.error'
):
raise
socket
.
error
raise
socket
.
error
def
raise_herror
(
*
args
,
**
kwargs
):
with
self
.
assertRaises
(
socket
.
error
,
msg
=
msg
%
'socket.herror'
):
raise
socket
.
herror
raise
socket
.
herror
def
raise_gaierror
(
*
args
,
**
kwargs
):
with
self
.
assertRaises
(
socket
.
error
,
msg
=
msg
%
'socket.gaierror'
):
raise
socket
.
gaierror
raise
socket
.
gaierror
self
.
assertRaises
(
socket
.
error
,
raise_error
,
"Error raising socket exception."
)
self
.
assertRaises
(
socket
.
error
,
raise_herror
,
"Error raising socket exception."
)
self
.
assertRaises
(
socket
.
error
,
raise_gaierror
,
"Error raising socket exception."
)
def
testSendtoErrors
(
self
):
def
testSendtoErrors
(
self
):
# Testing that sendto doens't masks failures. See #10169.
# Testing that sendto doens't masks failures. See #10169.
...
...
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