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
3de75266
Commit
3de75266
authored
Nov 09, 2002
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Whitespace normalization.
parent
e7130315
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
296 additions
and
296 deletions
+296
-296
Lib/test/test_b1.py
Lib/test/test_b1.py
+13
-13
Lib/test/test_bz2.py
Lib/test/test_bz2.py
+260
-260
Lib/test/test_codeccallbacks.py
Lib/test/test_codeccallbacks.py
+5
-5
Lib/test/test_pep277.py
Lib/test/test_pep277.py
+4
-4
Lib/test/test_sets.py
Lib/test/test_sets.py
+4
-4
Lib/test/test_support.py
Lib/test/test_support.py
+1
-1
Lib/test/test_trace.py
Lib/test/test_trace.py
+9
-9
No files found.
Lib/test/test_b1.py
View file @
3de75266
...
...
@@ -470,8 +470,8 @@ try: int('1' * 600)
except
:
raise
TestFailed
(
"int('1' * 600) didn't return long"
)
if
have_unicode
:
try
:
int
(
unichr
(
0x661
)
*
600
)
except
:
raise
TestFailed
(
"int('
\
\
u0661' * 600) didn't return long"
)
try
:
int
(
unichr
(
0x661
)
*
600
)
except
:
raise
TestFailed
(
"int('
\
\
u0661' * 600) didn't return long"
)
try
:
int
(
1
,
12
)
except
TypeError
:
pass
...
...
@@ -539,17 +539,17 @@ if sys.maxint == 0x7fffffff:
# XXX If/when PySequence_Length() returns a ssize_t, it should be
# XXX re-enabled.
try
:
# Verify clearing of bug #556025.
# This assumes that the max data size (sys.maxint) == max
# address size this also assumes that the address size is at
# least 4 bytes with 8 byte addresses, the bug is not well
# tested
#
# Note: This test is expected to SEGV under Cygwin 1.3.12 or
# earlier due to a newlib bug. See the following mailing list
# thread for the details:
# http://sources.redhat.com/ml/newlib/2002/msg00369.html
# Verify clearing of bug #556025.
# This assumes that the max data size (sys.maxint) == max
# address size this also assumes that the address size is at
# least 4 bytes with 8 byte addresses, the bug is not well
# tested
#
# Note: This test is expected to SEGV under Cygwin 1.3.12 or
# earlier due to a newlib bug. See the following mailing list
# thread for the details:
# http://sources.redhat.com/ml/newlib/2002/msg00369.html
list
(
xrange
(
sys
.
maxint
//
2
))
except
MemoryError
:
pass
...
...
Lib/test/test_bz2.py
View file @
3de75266
This diff is collapsed.
Click to expand it.
Lib/test/test_codeccallbacks.py
View file @
3de75266
...
...
@@ -213,10 +213,10 @@ class CodecCallbackTest(unittest.TestCase):
for
uni
in
[
s
*
l
for
s
in
(
u"x"
,
u"
\
u3042
"
,
u"a
\
xe4
"
)
]:
for
enc
in
(
"ascii"
,
"latin-1"
,
"iso-8859-1"
,
"iso-8859-15"
,
"utf-8"
,
"utf-7"
,
"utf-16"
):
for
err
in
errors
:
try
:
uni
.
encode
(
enc
,
err
)
except
UnicodeError
:
pass
try
:
uni
.
encode
(
enc
,
err
)
except
UnicodeError
:
pass
def
check_exceptionobjectargs
(
self
,
exctype
,
args
,
msg
):
# Test UnicodeError subclasses: construction, attribute assignment and __str__ conversion
...
...
@@ -229,7 +229,7 @@ class CodecCallbackTest(unittest.TestCase):
for
i
in
xrange
(
len
(
args
)):
for
wrongarg
in
wrongargs
:
if
type
(
wrongarg
)
is
type
(
args
[
i
]):
continue
continue
# build argument array
callargs
=
[]
for
j
in
xrange
(
len
(
args
)):
...
...
Lib/test/test_pep277.py
View file @
3de75266
...
...
@@ -52,10 +52,10 @@ class UnicodeFileTests(unittest.TestCase):
%
(
fn
.
__name__
,
filename
))
except
expected_exception
,
details
:
if
check_fn_in_exception
and
details
.
filename
!=
filename
:
raise
TestFailed
(
"Function '%s(%r) failed with "
"bad filename in the exception: %r"
%
(
fn
.
__name__
,
filename
,
details
.
filename
))
raise
TestFailed
(
"Function '%s(%r) failed with "
"bad filename in the exception: %r"
%
(
fn
.
__name__
,
filename
,
details
.
filename
))
def
test_failures
(
self
):
# Pass non-existing Unicode filenames all over the place.
...
...
Lib/test/test_sets.py
View file @
3de75266
...
...
@@ -446,10 +446,10 @@ class TestSubsetEmptyNonEmpty(TestSubsets):
#------------------------------------------------------------------------------
class
TestSubsetPartial
(
TestSubsets
):
left
=
Set
([
1
])
right
=
Set
([
1
,
2
])
name
=
"one a non-empty proper subset of other"
cases
=
"!="
,
"<"
,
"<="
left
=
Set
([
1
])
right
=
Set
([
1
,
2
])
name
=
"one a non-empty proper subset of other"
cases
=
"!="
,
"<"
,
"<="
#------------------------------------------------------------------------------
...
...
Lib/test/test_support.py
View file @
3de75266
...
...
@@ -109,7 +109,7 @@ except IOError:
TESTFN
=
TMP_TESTFN
del
TMP_TESTFN
except
IOError
:
print
(
'WARNING: tests will fail, unable to write to: %s or %s'
%
print
(
'WARNING: tests will fail, unable to write to: %s or %s'
%
(
TESTFN
,
TMP_TESTFN
))
if
fp
is
not
None
:
fp
.
close
()
...
...
Lib/test/test_trace.py
View file @
3de75266
...
...
@@ -107,7 +107,7 @@ def _settrace_and_return(tracefunc):
sys
.
_getframe
().
f_back
.
f_trace
=
tracefunc
def
settrace_and_return
(
tracefunc
):
_settrace_and_return
(
tracefunc
)
settrace_and_return
.
events
=
[(
1
,
'return'
)]
def
_settrace_and_raise
(
tracefunc
):
...
...
@@ -119,7 +119,7 @@ def settrace_and_raise(tracefunc):
_settrace_and_raise
(
tracefunc
)
except
RuntimeError
,
exc
:
pass
settrace_and_raise
.
events
=
[(
2
,
'exception'
),
(
3
,
'line'
),
(
4
,
'line'
),
...
...
@@ -134,14 +134,14 @@ class Tracer:
class
TraceTestCase
(
unittest
.
TestCase
):
def
compare_events
(
self
,
line_offset
,
events
,
expected_events
):
events
=
[(
l
-
line_offset
,
e
)
for
(
l
,
e
)
in
events
]
events
=
[(
l
-
line_offset
,
e
)
for
(
l
,
e
)
in
events
]
if
events
!=
expected_events
:
self
.
fail
(
"events did not match expectation:
\
n
"
+
"
\
n
"
.
join
(
difflib
.
ndiff
(
map
(
str
,
expected_events
),
map
(
str
,
events
))))
def
run_test
(
self
,
func
):
tracer
=
Tracer
()
sys
.
settrace
(
tracer
.
trace
)
...
...
@@ -156,7 +156,7 @@ class TraceTestCase(unittest.TestCase):
sys
.
settrace
(
None
)
self
.
compare_events
(
func
.
func_code
.
co_firstlineno
,
tracer
.
events
,
func
.
events
)
def
test_1_basic
(
self
):
self
.
run_test
(
basic
)
def
test_2_arigo
(
self
):
...
...
@@ -185,7 +185,7 @@ class RaisingTraceFuncTestCase(unittest.TestCase):
raise
ValueError
# just something that isn't RuntimeError
else
:
return
self
.
trace
def
f
(
self
):
"""The function to trace; raises an exception if that's the case
we're testing, so that the 'exception' trace event fires."""
...
...
@@ -194,7 +194,7 @@ class RaisingTraceFuncTestCase(unittest.TestCase):
y
=
1
/
x
else
:
return
1
def
run_test_for_event
(
self
,
event
):
"""Tests that an exception raised in response to the given event is
handled OK."""
...
...
@@ -210,7 +210,7 @@ class RaisingTraceFuncTestCase(unittest.TestCase):
self
.
fail
(
"exception not thrown!"
)
except
RuntimeError
:
self
.
fail
(
"recursion counter not reset"
)
# Test the handling of exceptions raised by each kind of trace event.
def
test_call
(
self
):
self
.
run_test_for_event
(
'call'
)
...
...
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