diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2017-05-09 19:22:53 +0100 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2017-05-22 17:15:09 +0000 |
commit | 6914a229a038206341ae1fea46393965a555ca9a (patch) | |
tree | 4a11cfaed46dabc827c5ee17cd976f42b5f53d49 /ext/pybind11/tests/conftest.py | |
parent | ca1d18d599dcc620bf526fb22042af95b1b60b68 (diff) | |
download | gem5-6914a229a038206341ae1fea46393965a555ca9a.tar.xz |
ext: Upgrade PyBind11 to version 2.1.1
Change-Id: I16870dec402d661295f9d013dc23e362b2b2c169
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/3225
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'ext/pybind11/tests/conftest.py')
-rw-r--r-- | ext/pybind11/tests/conftest.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/ext/pybind11/tests/conftest.py b/ext/pybind11/tests/conftest.py index d4335fc6d..5b08004e3 100644 --- a/ext/pybind11/tests/conftest.py +++ b/ext/pybind11/tests/conftest.py @@ -10,6 +10,8 @@ import difflib import re import sys import contextlib +import platform +import gc _unicode_marker = re.compile(r'u(\'[^\']*\')') _long_marker = re.compile(r'([0-9])L') @@ -101,9 +103,9 @@ class Capture(object): @pytest.fixture -def capture(capfd): - """Extended `capfd` with context manager and custom equality operators""" - return Capture(capfd) +def capture(capsys): + """Extended `capsys` with context manager and custom equality operators""" + return Capture(capsys) class SanitizedString(object): @@ -176,6 +178,13 @@ def suppress(exception): pass +def gc_collect(): + ''' Run the garbage collector twice (needed when running + reference counting tests with PyPy) ''' + gc.collect() + gc.collect() + + def pytest_namespace(): """Add import suppression and test requirements to `pytest` namespace""" try: @@ -190,6 +199,7 @@ def pytest_namespace(): from pybind11_tests import have_eigen except ImportError: have_eigen = False + pypy = platform.python_implementation() == "PyPy" skipif = pytest.mark.skipif return { @@ -200,6 +210,8 @@ def pytest_namespace(): reason="eigen and/or numpy are not installed"), 'requires_eigen_and_scipy': skipif(not have_eigen or not scipy, reason="eigen and/or scipy are not installed"), + 'unsupported_on_pypy': skipif(pypy, reason="unsupported on PyPy"), + 'gc_collect': gc_collect } |