Skip to content

Commit

Permalink
DOC: Remove preference for pytest paradigm in assert_raises_regex (pa…
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyoung authored and stangirala committed Jun 11, 2017
1 parent 07eea22 commit 8d4ff66
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions pandas/util/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2424,15 +2424,8 @@ def assert_raises_regex(_exception, _regexp, _callable=None,
Check that the specified Exception is raised and that the error message
matches a given regular expression pattern. This may be a regular
expression object or a string containing a regular expression suitable
for use by `re.search()`.
This is a port of the `assertRaisesRegexp` function from unittest in
Python 2.7. However, with our migration to `pytest`, please refrain
from using this. Instead, use the following paradigm:
with pytest.raises(_exception) as exc_info:
func(*args, **kwargs)
exc_info.matches(reg_exp)
for use by `re.search()`. This is a port of the `assertRaisesRegexp`
function from unittest in Python 2.7.
Examples
--------
Expand Down

0 comments on commit 8d4ff66

Please sign in to comment.