Skip to content

Commit

Permalink
remove skip on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
cocolato committed Jul 15, 2024
1 parent 72eb467 commit 000bcba
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 28 deletions.
9 changes: 2 additions & 7 deletions tests/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
from __future__ import absolute_import

import os
import multiprocessing
import multiprocess
import socket
import sys
import time
import uuid

Expand All @@ -22,10 +21,6 @@
"addressbook.thrift"))


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


class Dispatcher():
def __init__(self):
self.ab = addressbook.AddressBook()
Expand Down Expand Up @@ -81,7 +76,7 @@ def get_headers(self):
def server(request):
server = make_server(addressbook.AddressBookService, Dispatcher(),
host="127.0.0.1", port=6080)
ps = multiprocessing.Process(target=server.serve)
ps = multiprocess.Process(target=server.serve)
ps.start()

time.sleep(0.1)
Expand Down
9 changes: 2 additions & 7 deletions tests/test_multiplexed.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

from __future__ import absolute_import

import multiprocessing
import multiprocess
import os
import sys
import time

import pytest
Expand All @@ -20,10 +19,6 @@
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 Expand Up @@ -51,7 +46,7 @@ def server(request):
_server = TThreadedServer(mux_proc, TServerSocket(unix_socket=sock_path),
iprot_factory=TBinaryProtocolFactory(),
itrans_factory=TBufferedTransportFactory())
ps = multiprocessing.Process(target=_server.serve)
ps = multiprocess.Process(target=_server.serve)
ps.start()
time.sleep(0.1)

Expand Down
8 changes: 2 additions & 6 deletions tests/test_oneway.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@

import pytest

import multiprocessing
import multiprocess
import thriftpy2
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 All @@ -24,7 +20,7 @@ class TestOneway(object):
oneway_thrift = thriftpy2.load("oneway.thrift")

def setup_class(self):
ctx = multiprocessing.get_context("fork")
ctx = multiprocess.get_context("fork")
server = make_server(self.oneway_thrift.echo, Dispatcher(), '127.0.0.1', 6000)
self.p = ctx.Process(target=server.serve)
self.p.start()
Expand Down
11 changes: 3 additions & 8 deletions tests/test_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
from __future__ import absolute_import

import contextlib
import multiprocessing
import multiprocess
import os
import pickle
import random
import socket
import sys
import tempfile
import time

Expand Down Expand Up @@ -56,11 +55,7 @@
except ImportError:
pass
else:
cleanup_on_sigterm()


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


addressbook = thriftpy2.load(os.path.join(os.path.dirname(__file__),
Expand Down Expand Up @@ -191,7 +186,7 @@ def gen_server(port, tracker=tracker, processor=TTrackedProcessor):
server = TSampleServer(processor, server_socket,
prot_factory=TBinaryProtocolFactory(),
trans_factory=TBufferedTransportFactory())
ps = multiprocessing.Process(target=server.serve)
ps = multiprocess.Process(target=server.serve)
ps.start()
return ps, server

Expand Down

0 comments on commit 000bcba

Please sign in to comment.