From 31f7a45b9f8f496ab0a32ffd64983bda7aa89ff7 Mon Sep 17 00:00:00 2001 From: AN Long Date: Sat, 6 Apr 2024 19:02:57 +0800 Subject: [PATCH] Fix tests --- tests/test_cytransport.py | 7 ++++--- tests/test_protocol_cybinary.py | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/test_cytransport.py b/tests/test_cytransport.py index 41379db4..d147db0a 100644 --- a/tests/test_cytransport.py +++ b/tests/test_cytransport.py @@ -2,14 +2,15 @@ import pytest -from thriftpy2._compat import PYPY +from thriftpy2._compat import CYTHON -pytestmark = pytest.mark.skipif(PYPY, reason="cython not enabled in pypy.") -if not PYPY: +if CYTHON: from thriftpy2.transport.framed import TCyFramedTransport from thriftpy2.transport.buffered import TCyBufferedTransport from thriftpy2.transport import TMemoryBuffer, TTransportException +else: + pytest.skip("cython not enabled.", allow_module_level=True) def test_transport_mismatch(): diff --git a/tests/test_protocol_cybinary.py b/tests/test_protocol_cybinary.py index b71a7700..997bb5b1 100644 --- a/tests/test_protocol_cybinary.py +++ b/tests/test_protocol_cybinary.py @@ -7,16 +7,16 @@ import pytest -from thriftpy2._compat import PYPY +from thriftpy2._compat import CYTHON from thriftpy2.thrift import TDecodeException, TPayload, TType from thriftpy2.transport import TServerSocket, TSocket from thriftpy2.utils import hexlify -if not PYPY: +if CYTHON: from thriftpy2.protocol import cybin as proto from thriftpy2.transport.buffered import TCyBufferedTransport from thriftpy2.transport.memory import TCyMemoryBuffer else: - pytest.skip("cython not enabled in pypy.", allow_module_level=True) + pytest.skip("cython not enabled.", allow_module_level=True) class TItem(TPayload):