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
b7e419eb
Kaydet (Commit)
b7e419eb
authored
16 years ago
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use inspect.getabsfile() to get the documented module's filename.
üst
fb3de1fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
test_pydoc.py
Lib/test/test_pydoc.py
+3
-7
No files found.
Lib/test/test_pydoc.py
Dosyayı görüntüle @
b7e419eb
...
...
@@ -3,6 +3,7 @@ import difflib
import
subprocess
import
re
import
pydoc
import
inspect
import
unittest
import
test.test_support
...
...
@@ -196,17 +197,12 @@ def print_diffs(text1, text2):
tofile
=
'got'
)
print
'
\n
'
+
''
.
join
(
diffs
)
def
get_mod_file
(
module
):
"""Returns the name of the .py file if the module is compiled"""
mod_file
=
module
.
__file__
return
mod_file
if
mod_file
.
endswith
(
"py"
)
else
mod_file
[:
-
3
]
+
"py"
class
PyDocDocTest
(
unittest
.
TestCase
):
def
test_html_doc
(
self
):
result
=
get_pydoc_html
(
pydoc_mod
)
mod_file
=
get_mod_
file
(
pydoc_mod
)
mod_file
=
inspect
.
getabs
file
(
pydoc_mod
)
expected_html
=
expected_html_pattern
%
(
mod_file
,
mod_file
)
if
result
!=
expected_html
:
print_diffs
(
expected_html
,
result
)
...
...
@@ -214,7 +210,7 @@ class PyDocDocTest(unittest.TestCase):
def
test_text_doc
(
self
):
result
=
get_pydoc_text
(
pydoc_mod
)
expected_text
=
expected_text_pattern
%
get_mod_
file
(
pydoc_mod
)
expected_text
=
expected_text_pattern
%
inspect
.
getabs
file
(
pydoc_mod
)
if
result
!=
expected_text
:
print_diffs
(
expected_text
,
result
)
self
.
fail
(
"outputs are not equal, see diff above"
)
...
...
This diff is collapsed.
Click to expand it.
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