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
80f0c824
Commit
80f0c824
authored
Oct 12, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed and optimized a test of issue #22526.
parent
987a02b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
Lib/test/test_file2k.py
Lib/test/test_file2k.py
+8
-6
No files found.
Lib/test/test_file2k.py
View file @
80f0c824
...
...
@@ -14,7 +14,7 @@ except ImportError:
threading
=
None
from
test
import
test_support
from
test.test_support
import
TESTFN
,
run_unittest
from
test.test_support
import
TESTFN
,
run_unittest
,
requires
from
UserList
import
UserList
class
AutoFileTests
(
unittest
.
TestCase
):
...
...
@@ -437,16 +437,18 @@ class OtherFileTests(unittest.TestCase):
f
.
close
()
@
unittest
.
skipUnless
(
sys
.
maxsize
>
2
**
31
,
"requires 64-bit system"
)
@
test_support
.
precisionbigmemtest
(
2
**
31
,
1
)
def
test_very_long_line
(
self
,
max
size
):
@
test_support
.
precisionbigmemtest
(
2
**
31
,
2.5
,
dry_run
=
False
)
def
test_very_long_line
(
self
,
size
):
# Issue #22526
requires
(
'largefile'
)
with
open
(
TESTFN
,
"wb"
)
as
fp
:
fp
.
write
(
"
\
0
"
*
2
**
31
)
fp
.
seek
(
size
-
1
)
fp
.
write
(
"
\
0
"
)
with
open
(
TESTFN
,
"rb"
)
as
fp
:
for
l
in
fp
:
pass
self
.
assertEqual
(
len
(
l
),
2
**
31
)
self
.
assertEqual
(
l
.
count
(
"
\
0
"
),
2
**
31
)
self
.
assertEqual
(
len
(
l
),
size
)
self
.
assertEqual
(
l
.
count
(
"
\
0
"
),
size
)
l
=
None
class
FileSubclassTests
(
unittest
.
TestCase
):
...
...
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