summaryrefslogtreecommitdiff
path: root/six.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-01-02 09:24:53 -0600
committerBenjamin Peterson <benjamin@python.org>2015-01-02 09:24:53 -0600
commit753c6af25838fe8f3e357bc058ddad8ced35e620 (patch)
tree5cfe14baf53a1d48dbff9e27c6ed2b1242db9da4 /six.py
parentd5ca48d0fbfe6e88e432a43dd0ce4e42874a3a30 (diff)
parent8f481c478b9aac37a907eeb58b5e0804a7f4d1a0 (diff)
downloadsix-git-753c6af25838fe8f3e357bc058ddad8ced35e620.tar.gz
Merged in timograham/six (pull request #57)
Added unittest aliases.
Diffstat (limited to 'six.py')
-rw-r--r--six.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/six.py b/six.py
index 686c20a..8cca408 100644
--- a/six.py
+++ b/six.py
@@ -610,6 +610,9 @@ if PY3:
import io
StringIO = io.StringIO
BytesIO = io.BytesIO
+ _assertCountEqual = "assertCountEqual"
+ _assertRaisesRegex = "assertRaisesRegex"
+ _assertRegex = "assertRegex"
else:
def b(s):
return s
@@ -625,10 +628,25 @@ else:
iterbytes = functools.partial(itertools.imap, ord)
import StringIO
StringIO = BytesIO = StringIO.StringIO
+ _assertCountEqual = "assertItemsEqual"
+ _assertRaisesRegex = "assertRaisesRegexp"
+ _assertRegex = "assertRegexpMatches"
_add_doc(b, """Byte literal""")
_add_doc(u, """Text literal""")
+def assertCountEqual(self, *args, **kwargs):
+ return getattr(self, _assertCountEqual)(*args, **kwargs)
+
+
+def assertRaisesRegex(self, *args, **kwargs):
+ return getattr(self, _assertRaisesRegex)(*args, **kwargs)
+
+
+def assertRegex(self, *args, **kwargs):
+ return getattr(self, _assertRegex)(*args, **kwargs)
+
+
if PY3:
exec_ = getattr(moves.builtins, "exec")