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
b1295da5
Commit
b1295da5
authored
Apr 01, 2002
by
Neal Norwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
There is no TestError, use TestFailed appropriately
parent
8392f365
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
Lib/test/test_descr.py
Lib/test/test_descr.py
+1
-1
Lib/test/test_file.py
Lib/test/test_file.py
+8
-8
Lib/test/test_mpz.py
Lib/test/test_mpz.py
+1
-1
No files found.
Lib/test/test_descr.py
View file @
b1295da5
...
...
@@ -785,7 +785,7 @@ def metaclass():
c
=
C
()
try
:
c
()
except
TypeError
:
pass
else
:
raise
Test
Error
,
"calling object w/o call method should raise TypeError"
else
:
raise
Test
Failed
,
"calling object w/o call method should raise TypeError"
def
pymods
():
if
verbose
:
print
"Testing Python subclass of module..."
...
...
Lib/test/test_file.py
View file @
b1295da5
import
os
from
array
import
array
from
test_support
import
verify
,
TESTFN
from
test_support
import
verify
,
TESTFN
,
TestFailed
from
UserList
import
UserList
# verify writelines with instance sequence
...
...
@@ -70,23 +70,23 @@ else:
f
=
open
(
TESTFN
)
if
f
.
name
!=
TESTFN
:
raise
Test
Error
,
'file.name should be "%s"'
%
TESTFN
raise
Test
Failed
,
'file.name should be "%s"'
%
TESTFN
if
f
.
isatty
():
raise
Test
Error
,
'file.isatty() should be false'
raise
Test
Failed
,
'file.isatty() should be false'
if
f
.
closed
:
raise
Test
Error
,
'file.closed should be false'
raise
Test
Failed
,
'file.closed should be false'
try
:
f
.
readinto
(
""
)
except
TypeError
:
pass
else
:
raise
Test
Error
,
'file.readinto("") should raise a TypeError'
raise
Test
Failed
,
'file.readinto("") should raise a TypeError'
f
.
close
()
if
not
f
.
closed
:
raise
Test
Error
,
'file.closed should be true'
raise
Test
Failed
,
'file.closed should be true'
for
methodname
in
[
'fileno'
,
'flush'
,
'isatty'
,
'read'
,
'readinto'
,
'readline'
,
'readlines'
,
'seek'
,
'tell'
,
'truncate'
,
'write'
,
'xreadlines'
]:
method
=
getattr
(
f
,
methodname
)
...
...
@@ -95,13 +95,13 @@ for methodname in ['fileno', 'flush', 'isatty', 'read', 'readinto', 'readline',
except
ValueError
:
pass
else
:
raise
Test
Error
,
'file.%s() on a closed file should raise a ValueError'
%
methodname
raise
Test
Failed
,
'file.%s() on a closed file should raise a ValueError'
%
methodname
try
:
f
.
writelines
([])
except
ValueError
:
pass
else
:
raise
Test
Error
,
'file.writelines([]) on a closed file should raise a ValueError'
raise
Test
Failed
,
'file.writelines([]) on a closed file should raise a ValueError'
os
.
unlink
(
TESTFN
)
Lib/test/test_mpz.py
View file @
b1295da5
import
mpz
from
test_support
import
vereq
from
test_support
import
vereq
,
TestFailed
def
check_conversion
(
num
):
mpz_num
=
mpz
.
mpz
(
num
)
...
...
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