[pypy-commit] pypy default: test interesting part of error message, not the op name
mattip
pypy.commits at gmail.com
Wed Jan 22 01:00:44 EST 2020
Author: Matti Picus <matti.picus at gmail.com>
Branch:
Changeset: r98567:efe314c692e9
Date: 2020-01-22 16:47 +1100
http://bitbucket.org/pypy/pypy/changeset/efe314c692e9/
Log: test interesting part of error message, not the op name
diff --git a/pypy/interpreter/test/test_argument.py b/pypy/interpreter/test/test_argument.py
--- a/pypy/interpreter/test/test_argument.py
+++ b/pypy/interpreter/test/test_argument.py
@@ -759,12 +759,11 @@
# does not contain the warning about missing self
assert exc.value.message == "f0() takes no arguments (1 given)"
- @pytest.mark.pypy_only
def test_error_message_module_function(self):
import operator # use repeat because it's defined at applevel
exc = raises(TypeError, lambda : operator.repeat(1, 2, 3))
# does not contain the warning about missing self
- assert exc.value.message == "repeat() takes exactly 2 arguments (3 given)"
+ assert "takes exactly 2 arguments (3 given)" in str(exc.value)
@pytest.mark.pypy_only
def test_error_message_bound_method(self):
More information about the pypy-commit
mailing list