Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
2acbae80
Kaydet (Commit)
2acbae80
authored
Eki 29, 2014
tarafından
Zachary Ware
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #22173: Update lib2to3 tests to use unittest test discovery.
üst
b7354a65
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
38 deletions
+19
-38
main.py
Lib/lib2to3/main.py
+1
-1
__init__.py
Lib/lib2to3/tests/__init__.py
+3
-18
__main__.py
Lib/lib2to3/tests/__main__.py
+4
-0
pytree_idempotency.py
Lib/lib2to3/tests/pytree_idempotency.py
+2
-0
test_all_fixers.py
Lib/lib2to3/tests/test_all_fixers.py
+5
-0
test_lib2to3.py
Lib/test/test_lib2to3.py
+2
-19
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/lib2to3/main.py
Dosyayı görüntüle @
2acbae80
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
Main program for 2to3.
Main program for 2to3.
"""
"""
from
__future__
import
with_statement
from
__future__
import
with_statement
,
print_function
import
sys
import
sys
import
os
import
os
...
...
Lib/lib2to3/tests/__init__.py
Dosyayı görüntüle @
2acbae80
"""Make tests/ into a package. This allows us to "import tests" and
have tests.all_tests be a TestSuite representing all test cases
from all test_*.py files in tests/."""
# Author: Collin Winter
# Author: Collin Winter
import
os
import
os
import
os.path
import
unittest
import
unittest
import
types
from
.
import
support
from
test.support
import
load_package_tests
all_tests
=
unittest
.
TestSuite
()
def
load_tests
(
*
args
):
return
load_package_tests
(
os
.
path
.
dirname
(
__file__
),
*
args
)
tests_dir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'tests'
)
tests
=
[
t
[
0
:
-
3
]
for
t
in
os
.
listdir
(
tests_dir
)
if
t
.
startswith
(
'test_'
)
and
t
.
endswith
(
'.py'
)]
loader
=
unittest
.
TestLoader
()
for
t
in
tests
:
__import__
(
""
,
globals
(),
locals
(),[
t
],
level
=
1
)
mod
=
globals
()[
t
]
all_tests
.
addTests
(
loader
.
loadTestsFromModule
(
mod
))
Lib/lib2to3/tests/__main__.py
0 → 100644
Dosyayı görüntüle @
2acbae80
from
.
import
load_tests
import
unittest
unittest
.
main
()
Lib/lib2to3/tests/pytree_idempotency.py
Dosyayı görüntüle @
2acbae80
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
"""Main program for testing the infrastructure."""
"""Main program for testing the infrastructure."""
from
__future__
import
print_function
__author__
=
"Guido van Rossum <guido@python.org>"
__author__
=
"Guido van Rossum <guido@python.org>"
# Support imports (need to be imported first)
# Support imports (need to be imported first)
...
...
Lib/lib2to3/tests/test_all_fixers.py
Dosyayı görüntüle @
2acbae80
...
@@ -7,12 +7,14 @@ running time.
...
@@ -7,12 +7,14 @@ running time.
# Python imports
# Python imports
import
unittest
import
unittest
import
test.support
# Local imports
# Local imports
from
lib2to3
import
refactor
from
lib2to3
import
refactor
from
.
import
support
from
.
import
support
@test.support.requires_resource
(
'cpu'
)
class
Test_all
(
support
.
TestCase
):
class
Test_all
(
support
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -21,3 +23,6 @@ class Test_all(support.TestCase):
...
@@ -21,3 +23,6 @@ class Test_all(support.TestCase):
def
test_all_project_files
(
self
):
def
test_all_project_files
(
self
):
for
filepath
in
support
.
all_project_files
():
for
filepath
in
support
.
all_project_files
():
self
.
refactor
.
refactor_file
(
filepath
)
self
.
refactor
.
refactor_file
(
filepath
)
if
__name__
==
'__main__'
:
unittest
.
main
()
Lib/test/test_lib2to3.py
Dosyayı görüntüle @
2acbae80
# Skipping test_parser and test_all_fixers
from
lib2to3.tests
import
load_tests
# because of running
from
lib2to3.tests
import
(
test_fixers
,
test_pytree
,
test_util
,
test_refactor
,
test_parser
,
test_main
as
test_main_
)
import
unittest
import
unittest
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
,
test_parser
,
test_main_
):
tests
.
addTests
(
loader
.
loadTestsFromModule
(
m
))
return
tests
def
test_main
():
run_unittest
(
suite
())
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
test_
main
()
unittest
.
main
()
Misc/NEWS
Dosyayı görüntüle @
2acbae80
...
@@ -87,6 +87,8 @@ Library
...
@@ -87,6 +87,8 @@ Library
Tests
Tests
-----
-----
-
Issue
#
22173
:
Update
lib2to3
tests
to
use
unittest
test
discovery
.
-
Issue
#
16000
:
Convert
test_curses
to
use
unittest
.
-
Issue
#
16000
:
Convert
test_curses
to
use
unittest
.
-
Issue
#
21456
:
Skip
two
tests
in
test_urllib2net
.
py
if
_ssl
module
not
-
Issue
#
21456
:
Skip
two
tests
in
test_urllib2net
.
py
if
_ssl
module
not
...
...
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