From 3ae13fc662435d69c7d93e937a675059164a495c Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 4 Jan 2014 17:43:35 -0600 Subject: fix py3 --- tests/test_utils.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'tests/test_utils.py') diff --git a/tests/test_utils.py b/tests/test_utils.py index 917e87f0..6f938f58 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -33,6 +33,16 @@ class FakeInterface(object): pass +class FakeBinding(object): + @classmethod + def _ensure_ffi_initialized(cls): + raise cffi.VerificationError + + @classmethod + def is_available(cls): + return binding_available(cls._ensure_ffi_initialized) + + def test_check_for_iface(): item = pretend.stub(keywords=["fake_name"], funcargs={"backend": True}) with pytest.raises(pytest.skip.Exception) as exc_info: @@ -84,15 +94,6 @@ def test_check_binding_available(): def test_check_binding_unavailable(): - class FakeBinding(object): - @classmethod - def _ensure_ffi_initialized(cls): - raise cffi.VerificationError - - @classmethod - def is_available(cls): - return binding_available(cls._ensure_ffi_initialized) - kwargs = pretend.stub(kwargs={"binding": FakeBinding}) item = pretend.stub(keywords={"binding_available": kwargs}) with pytest.raises(pytest.skip.Exception) as exc_info: -- cgit v1.2.3