Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8f776307
Commit
8f776307
authored
Dec 10, 2010
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#10273: Remove a "Matches" that I missed in r86910. Thanks to RDM for noticing it.
parent
522cc0a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
Lib/unittest/case.py
Lib/unittest/case.py
+1
-1
Lib/unittest/test/test_assertions.py
Lib/unittest/test/test_assertions.py
+4
-4
No files found.
Lib/unittest/case.py
View file @
8f776307
...
...
@@ -1127,7 +1127,7 @@ class TestCase(object):
msg
=
'%s: %r not found in %r'
%
(
msg
,
expected_regex
.
pattern
,
text
)
raise
self
.
failureException
(
msg
)
def
assertNotRegex
Matches
(
self
,
text
,
unexpected_regex
,
msg
=
None
):
def
assertNotRegex
(
self
,
text
,
unexpected_regex
,
msg
=
None
):
"""Fail the test if the text matches the regular expression."""
if
isinstance
(
unexpected_regex
,
(
str
,
bytes
)):
unexpected_regex
=
re
.
compile
(
unexpected_regex
)
...
...
Lib/unittest/test/test_assertions.py
View file @
8f776307
...
...
@@ -92,15 +92,15 @@ class Test_Assertions(unittest.TestCase):
else
:
self
.
fail
(
"assertRaises() didn't let exception pass through"
)
def
testAssertNotRegex
Matches
(
self
):
self
.
assertNotRegex
Matches
(
'Ala ma kota'
,
r'r+'
)
def
testAssertNotRegex
(
self
):
self
.
assertNotRegex
(
'Ala ma kota'
,
r'r+'
)
try
:
self
.
assertNotRegex
Matches
(
'Ala ma kota'
,
r'k.t'
,
'Message'
)
self
.
assertNotRegex
(
'Ala ma kota'
,
r'k.t'
,
'Message'
)
except
self
.
failureException
as
e
:
self
.
assertIn
(
"'kot'"
,
e
.
args
[
0
])
self
.
assertIn
(
'Message'
,
e
.
args
[
0
])
else
:
self
.
fail
(
'assertNotRegex
Matches
should have failed.'
)
self
.
fail
(
'assertNotRegex should have failed.'
)
class
TestLongMessage
(
unittest
.
TestCase
):
...
...
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