diff --git a/tests/test_http.py b/tests/test_http.py index 6d7493a..e5ac0e4 100644 --- a/tests/test_http.py +++ b/tests/test_http.py @@ -3,9 +3,8 @@ from __future__ import absolute_import import os -import multiprocessing +import multiprocess import socket -import sys import time import uuid @@ -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() @@ -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) diff --git a/tests/test_multiplexed.py b/tests/test_multiplexed.py index 3f38abf..9d62c59 100644 --- a/tests/test_multiplexed.py +++ b/tests/test_multiplexed.py @@ -2,9 +2,8 @@ from __future__ import absolute_import -import multiprocessing +import multiprocess import os -import sys import time import pytest @@ -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" @@ -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) diff --git a/tests/test_oneway.py b/tests/test_oneway.py index fcf88ba..a70f413 100644 --- a/tests/test_oneway.py +++ b/tests/test_oneway.py @@ -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) @@ -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() diff --git a/tests/test_tracking.py b/tests/test_tracking.py index 9d71d4d..a971379 100644 --- a/tests/test_tracking.py +++ b/tests/test_tracking.py @@ -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 @@ -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__), @@ -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