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
cb9c5ba7
Commit
cb9c5ba7
authored
Oct 07, 2011
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Re-enable lib2to3's test_parser.py tests, though with an expected failure
(see issue 13125).
parent
dd07732a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
10 deletions
+20
-10
Lib/lib2to3/tests/test_parser.py
Lib/lib2to3/tests/test_parser.py
+15
-9
Lib/test/test_lib2to3.py
Lib/test/test_lib2to3.py
+2
-1
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/lib2to3/tests/test_parser.py
View file @
cb9c5ba7
...
...
@@ -14,6 +14,7 @@ from .support import driver, test_dir
# Python imports
import
os
import
unittest
# Local imports
from
lib2to3.pgen2
import
tokenize
...
...
@@ -157,6 +158,8 @@ class TestParserIdempotency(support.TestCase):
"""A cut-down version of pytree_idempotency.py."""
# Issue 13125
@
unittest
.
expectedFailure
def
test_all_project_files
(
self
):
for
filepath
in
support
.
all_project_files
():
with
open
(
filepath
,
"rb"
)
as
fp
:
...
...
@@ -165,8 +168,11 @@ class TestParserIdempotency(support.TestCase):
"can't detect encoding for %s"
%
filepath
)
with
open
(
filepath
,
"r"
)
as
fp
:
source
=
fp
.
read
()
source
=
source
.
decode
(
encoding
)
tree
=
driver
.
parse_string
(
source
)
try
:
tree
=
driver
.
parse_string
(
source
)
except
ParseError
as
err
:
print
(
'ParseError on file'
,
filepath
,
err
)
continue
new
=
str
(
tree
)
if
encoding
:
new
=
new
.
encode
(
encoding
)
...
...
@@ -212,14 +218,14 @@ class TestLiterals(GrammarTest):
self
.
validate
(
s
)
def
diff
(
fn
,
result
,
encoding
):
f
=
open
(
"@"
,
"w"
)
try
:
f
.
write
(
result
.
encode
(
encoding
))
finally
:
f
.
close
()
def
diff
(
fn
,
result
):
try
:
with
open
(
'@'
,
'w'
)
as
f
:
f
.
write
(
str
(
result
))
fn
=
fn
.
replace
(
'"'
,
'
\
\
"'
)
return
os
.
system
(
'diff -u "%s" @'
%
fn
)
finally
:
os
.
remove
(
"@"
)
try
:
os
.
remove
(
"@"
)
except
OSError
:
pass
Lib/test/test_lib2to3.py
View file @
cb9c5ba7
# Skipping test_parser and test_all_fixers
# because of running
from
lib2to3.tests
import
(
test_fixers
,
test_pytree
,
test_util
,
test_refactor
,
test_parser
,
test_main
as
test_main_
)
import
unittest
from
test.support
import
run_unittest
...
...
@@ -8,7 +9,7 @@ from test.support import run_unittest
def
suite
():
tests
=
unittest
.
TestSuite
()
loader
=
unittest
.
TestLoader
()
for
m
in
(
test_fixers
,
test_pytree
,
test_util
,
test_refactor
,
for
m
in
(
test_fixers
,
test_pytree
,
test_util
,
test_refactor
,
test_parser
,
test_main_
):
tests
.
addTests
(
loader
.
loadTestsFromModule
(
m
))
return
tests
...
...
Misc/NEWS
View file @
cb9c5ba7
...
...
@@ -1382,6 +1382,9 @@ Extension Modules
Tests
-----
- Re-enable lib2to3'
s
test_parser
.
py
tests
,
though
with
an
expected
failure
(
see
issue
13125
).
-
Issue
#
12656
:
Add
tests
for
IPv6
and
Unix
sockets
to
test_asyncore
.
-
Issue
#
6484
:
Add
unit
tests
for
mailcap
module
(
patch
by
Gregory
Nofi
)
...
...
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