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
1a0ce685
Kaydet (Commit)
1a0ce685
authored
May 07, 2010
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
revert r80932; it breaks windows
üst
5dfad9dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
53 deletions
+1
-53
loader.py
Lib/unittest/loader.py
+1
-14
test_discovery.py
Lib/unittest/test/test_discovery.py
+0
-39
No files found.
Lib/unittest/loader.py
Dosyayı görüntüle @
1a0ce685
...
...
@@ -173,10 +173,7 @@ class TestLoader(object):
if
not
top_level_dir
in
sys
.
path
:
# all test modules must be importable from the top level directory
# should we *unconditionally* put the start directory in first
# in sys.path to minimise likelihood of conflicts between installed
# modules and development versions?
sys
.
path
.
insert
(
0
,
top_level_dir
)
sys
.
path
.
append
(
top_level_dir
)
self
.
_top_level_dir
=
top_level_dir
is_not_importable
=
False
...
...
@@ -249,16 +246,6 @@ class TestLoader(object):
except
:
yield
_make_failed_import_test
(
name
,
self
.
suiteClass
)
else
:
mod_file
=
os
.
path
.
abspath
(
getattr
(
module
,
'__file__'
,
full_path
))
realpath
=
os
.
path
.
splitext
(
mod_file
)[
0
]
fullpath_noext
=
os
.
path
.
splitext
(
full_path
)[
0
]
if
realpath
.
lower
()
!=
fullpath_noext
.
lower
():
module_dir
=
os
.
path
.
dirname
(
realpath
)
mod_name
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
full_path
))[
0
]
expected_dir
=
os
.
path
.
dirname
(
full_path
)
msg
=
(
"
%
r module incorrectly imported from
%
r. Expected
%
r. "
"Is this module globally installed?"
)
raise
ImportError
(
msg
%
(
mod_name
,
module_dir
,
expected_dir
))
yield
self
.
loadTestsFromModule
(
module
)
elif
os
.
path
.
isdir
(
full_path
):
if
not
os
.
path
.
isfile
(
os
.
path
.
join
(
full_path
,
'__init__.py'
)):
...
...
Lib/unittest/test/test_discovery.py
Dosyayı görüntüle @
1a0ce685
...
...
@@ -298,45 +298,6 @@ class TestDiscovery(unittest.TestCase):
self
.
assertTrue
(
program
.
failfast
)
self
.
assertTrue
(
program
.
catchbreak
)
def
test_detect_module_clash
(
self
):
class
Module
(
object
):
__file__
=
'bar/foo.py'
sys
.
modules
[
'foo'
]
=
Module
full_path
=
os
.
path
.
abspath
(
'foo'
)
original_listdir
=
os
.
listdir
original_isfile
=
os
.
path
.
isfile
original_isdir
=
os
.
path
.
isdir
def
cleanup
():
os
.
listdir
=
original_listdir
os
.
path
.
isfile
=
original_isfile
os
.
path
.
isdir
=
original_isdir
del
sys
.
modules
[
'foo'
]
if
full_path
in
sys
.
path
:
sys
.
path
.
remove
(
full_path
)
self
.
addCleanup
(
cleanup
)
def
listdir
(
_
):
return
[
'foo.py'
]
def
isfile
(
_
):
return
True
def
isdir
(
_
):
return
True
os
.
listdir
=
listdir
os
.
path
.
isfile
=
isfile
os
.
path
.
isdir
=
isdir
loader
=
unittest
.
TestLoader
()
mod_dir
=
os
.
path
.
abspath
(
'bar'
)
expected_dir
=
os
.
path
.
abspath
(
'foo'
)
msg
=
(
r"^'foo' module incorrectly imported from
%
r\. Expected
%
r\. "
"Is this module globally installed
\
?$"
)
%
(
mod_dir
,
expected_dir
)
self
.
assertRaisesRegexp
(
ImportError
,
msg
,
loader
.
discover
,
start_dir
=
'foo'
,
pattern
=
'foo.py'
)
self
.
assertEqual
(
sys
.
path
[
0
],
full_path
)
if
__name__
==
'__main__'
:
unittest
.
main
()
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