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
7d428788
Kaydet (Commit)
7d428788
authored
Eki 13, 2004
tarafından
Jim Fulton
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed a small bug. doctest didn't handle unicode docstrings containing
non-ascii characters.
üst
73cc8479
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
3 deletions
+26
-3
doctest.py
Lib/doctest.py
+3
-1
test_doctest2.py
Lib/test/test_doctest2.py
+16
-2
test_doctest2.txt
Lib/test/test_doctest2.txt
+7
-0
No files found.
Lib/doctest.py
Dosyayı görüntüle @
7d428788
...
...
@@ -962,7 +962,9 @@ class DocTestFinder:
if
obj
.
__doc__
is
None
:
docstring
=
''
else
:
docstring
=
str
(
obj
.
__doc__
)
docstring
=
obj
.
__doc__
if
not
isinstance
(
docstring
,
basestring
):
docstring
=
str
(
docstring
)
except
(
TypeError
,
AttributeError
):
docstring
=
''
...
...
Lib/test/test_doctest2.py
Dosyayı görüntüle @
7d428788
"""A module to test whether doctest recognizes some 2.2 features,
# -*- coding: utf-8 -*-
u"""A module to test whether doctest recognizes some 2.2 features,
like static and class methods.
>>> print 'yup' # 1
yup
We include some (random) encoded (utf-8) text in the text surrounding
the example. It should be ignored:
ЉЊЈЁЂ
"""
from
test
import
test_support
class
C
(
object
):
"""Class C.
u
"""Class C.
>>> print C() # 2
42
We include some (random) encoded (utf-8) text in the text surrounding
the example. It should be ignored:
ЉЊЈЁЂ
"""
def
__init__
(
self
):
...
...
Lib/test/test_doctest2.txt
Dosyayı görüntüle @
7d428788
...
...
@@ -5,3 +5,10 @@ In this example, we'll rely on some silly setup:
>>> import test.test_doctest
>>> test.test_doctest.sillySetup
True
This test also has some (random) encoded (utf-8) unicode text:
ÐÐÐÐÐ
This doesn't cause a problem in the tect surrounding the examples, but
we include it here (in this test text file) to make sure. :)
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