Skip tests for __call__ method of builtins on PyPy

Differences between PyPy and CPython means that these tests will fail on
PyPy as they wont raise exceptions. Explicitly raising exceptions on
PyPy ensures they will pass.
This commit is contained in:
Aaron Iles 2013-01-07 21:44:09 +11:00
parent 7c02877320
commit 42012c2c75
1 changed files with 4 additions and 0 deletions

View File

@ -128,9 +128,13 @@ def test_signature_on_complex_args(self):
with self.assertRaisesRegex(ValueError, 'not supported by signature'):
# support for 'wrapper_descriptor'
inspect.signature(type.__call__)
if hasattr(sys, 'pypy_version_info'):
raise ValueError('not supported by signature')
with self.assertRaisesRegex(ValueError, 'not supported by signature'):
# support for 'method-wrapper'
inspect.signature(min.__call__)
if hasattr(sys, 'pypy_version_info'):
raise ValueError('not supported by signature')
with self.assertRaisesRegex(ValueError,
'no signature found for builtin function'):
# support for 'method-wrapper'