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
ca4471f8
Commit
ca4471f8
authored
May 24, 2007
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test_bool and test_bufio.
parent
7b051c54
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
Lib/test/test_bool.py
Lib/test/test_bool.py
+2
-2
Lib/test/test_bufio.py
Lib/test/test_bufio.py
+5
-5
No files found.
Lib/test/test_bool.py
View file @
ca4471f8
...
...
@@ -26,10 +26,10 @@ class BoolTest(unittest.TestCase):
def
test_print
(
self
):
try
:
fo
=
open
(
test_support
.
TESTFN
,
"w
b
"
)
fo
=
open
(
test_support
.
TESTFN
,
"w"
)
print
(
False
,
True
,
file
=
fo
)
fo
.
close
()
fo
=
open
(
test_support
.
TESTFN
,
"r
b
"
)
fo
=
open
(
test_support
.
TESTFN
,
"r"
)
self
.
assertEqual
(
fo
.
read
(),
'False True
\
n
'
)
finally
:
fo
.
close
()
...
...
Lib/test/test_bufio.py
View file @
ca4471f8
...
...
@@ -19,12 +19,12 @@ class BufferSizeTest(unittest.TestCase):
try
:
# write once with \n and once without
f
.
write
(
s
)
f
.
write
(
"
\
n
"
)
f
.
write
(
b
"
\
n
"
)
f
.
write
(
s
)
f
.
close
()
f
=
open
(
test_support
.
TESTFN
,
"rb"
)
line
=
f
.
readline
()
self
.
assertEqual
(
line
,
s
+
"
\
n
"
)
self
.
assertEqual
(
line
,
s
+
b
"
\
n
"
)
line
=
f
.
readline
()
self
.
assertEqual
(
line
,
s
)
line
=
f
.
readline
()
...
...
@@ -48,16 +48,16 @@ class BufferSizeTest(unittest.TestCase):
teststring
=
pattern
*
q
+
pattern
[:
r
]
self
.
assertEqual
(
len
(
teststring
),
length
)
self
.
try_one
(
teststring
)
self
.
try_one
(
teststring
+
"x"
)
self
.
try_one
(
teststring
+
b
"x"
)
self
.
try_one
(
teststring
[:
-
1
])
def
test_primepat
(
self
):
# A pattern with prime length, to avoid simple relationships with
# stdio buffer sizes.
self
.
drive_one
(
"1234567890
\
00
\
01
\
02
\
03
\
04
\
05
\
06
"
)
self
.
drive_one
(
b
"1234567890
\
00
\
01
\
02
\
03
\
04
\
05
\
06
"
)
def
test_nullpat
(
self
):
self
.
drive_one
(
"
\
0
"
*
1000
)
self
.
drive_one
(
bytes
(
1000
)
)
def
test_main
():
test_support
.
run_unittest
(
BufferSizeTest
)
...
...
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