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
b0eb4d3e
Kaydet (Commit)
b0eb4d3e
authored
Şub 07, 2010
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use "regexp" consistently.
üst
9341ad22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
case.py
Lib/unittest/case.py
+8
-8
No files found.
Lib/unittest/case.py
Dosyayı görüntüle @
b0eb4d3e
...
...
@@ -88,7 +88,7 @@ class _AssertRaisesContext(object):
def
__init__
(
self
,
expected
,
test_case
,
expected_regexp
=
None
):
self
.
expected
=
expected
self
.
failureException
=
test_case
.
failureException
self
.
expected_regex
=
expected_regexp
self
.
expected_regex
p
=
expected_regexp
def
__enter__
(
self
):
pass
...
...
@@ -105,10 +105,10 @@ class _AssertRaisesContext(object):
# let unexpected exceptions pass through
return
False
self
.
exc_value
=
exc_value
#store for later retrieval
if
self
.
expected_regex
is
None
:
if
self
.
expected_regex
p
is
None
:
return
True
expected_regexp
=
self
.
expected_regex
expected_regexp
=
self
.
expected_regex
p
if
isinstance
(
expected_regexp
,
basestring
):
expected_regexp
=
re
.
compile
(
expected_regexp
)
if
not
expected_regexp
.
search
(
str
(
exc_value
)):
...
...
@@ -853,12 +853,12 @@ class TestCase(object):
with
context
:
callable_obj
(
*
args
,
**
kwargs
)
def
assertRegexpMatches
(
self
,
text
,
expected_regex
,
msg
=
None
):
if
isinstance
(
expected_regex
,
basestring
):
expected_regex
=
re
.
compile
(
expected_regex
)
if
not
expected_regex
.
search
(
text
):
def
assertRegexpMatches
(
self
,
text
,
expected_regex
p
,
msg
=
None
):
if
isinstance
(
expected_regex
p
,
basestring
):
expected_regex
p
=
re
.
compile
(
expected_regexp
)
if
not
expected_regex
p
.
search
(
text
):
msg
=
msg
or
"Regexp didn't match"
msg
=
'
%
s:
%
r not found in
%
r'
%
(
msg
,
expected_regex
.
pattern
,
text
)
msg
=
'
%
s:
%
r not found in
%
r'
%
(
msg
,
expected_regex
p
.
pattern
,
text
)
raise
self
.
failureException
(
msg
)
...
...
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