Skip to content

Commit

Permalink
Skip more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aisk committed Apr 6, 2024
1 parent f99b8f8 commit 9d81f81
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
10 changes: 9 additions & 1 deletion tests/test_framed_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@

import logging
import socket
import sys
import threading
import time

from os import path
from unittest import TestCase

import pytest
from tornado import ioloop

import thriftpy2
from thriftpy2._compat import CYTHON
from thriftpy2.tornado import make_server
from thriftpy2.rpc import make_client
from thriftpy2.transport.framed import TFramedTransportFactory
Expand All @@ -23,7 +26,12 @@
except ImportError:
asyncio = None

from thriftpy2._compat import CYTHON

if sys.platform == "win32":
pytest.skip("add_socket is not implemented on Windiws",
allow_module_level=True)


logging.basicConfig(level=logging.INFO)

addressbook = thriftpy2.load(path.join(path.dirname(__file__),
Expand Down
7 changes: 6 additions & 1 deletion tests/test_multiplexed.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

from __future__ import absolute_import

import os
import multiprocessing
import os
import sys
import time

import pytest
Expand All @@ -19,6 +20,10 @@
from thriftpy2.transport import TBufferedTransportFactory, TServerSocket


if sys.platform == "win32":
pytest.skip("requires fork", allow_module_level=True)


mux = thriftpy2.load(os.path.join(os.path.dirname(__file__),
"multiplexed.thrift"))
sock_path = "/tmp/thriftpy_test.sock"
Expand Down
10 changes: 9 additions & 1 deletion tests/test_oneway.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import sys
import time

import pytest

import multiprocessing
import thriftpy2
import time
from thriftpy2.rpc import make_client, make_server


if sys.platform == "win32":
pytest.skip("requires fork", allow_module_level=True)


class Dispatcher(object):
def Test(self, req):
print("Get req msg: %s" % req)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_protocol_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def test_write_huge_struct():
proto.TBinaryProtocol(b).write_struct(item)


@pytest.mark.skipif(_compat.PYPY, reason="cybin can't be used in pypy")
@pytest.mark.skipif(not _compat.CYTHON, reason="cybin required")
def test_string_binary_equivalency():
from thriftpy2.protocol.binary import TBinaryProtocolFactory
from thriftpy2.protocol.cybin import TCyBinaryProtocolFactory
Expand Down
2 changes: 2 additions & 0 deletions tests/test_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ def test_inet6_socket():
@pytest.mark.skipif(
sys.platform == 'darwin' and os.getuid() != 0,
reason='os.mknod() requires super-user privileges on darwin')
@pytest.mark.skipif(sys.platform == "win32",
reason="os.mknod is missing on Windows")
def test_unix_domain_socket():
sock_file = "/tmp/thriftpy_test.sock"

Expand Down

0 comments on commit 9d81f81

Please sign in to comment.