Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support use mp spawn mode for tests #263

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove skip on windows
  • Loading branch information
cocolato committed Jul 15, 2024
commit d67543175f730b3ec1bf39f0faf21b8bb0591f38
3 changes: 3 additions & 0 deletions tests/test_http.py
Original file line number Diff line number Diff line change
@@ -74,6 +74,9 @@ def get_headers(self):

@pytest.fixture(scope="module")
def server(request):
import thriftpy2
addressbook = thriftpy2.load(os.path.join(os.path.dirname(__file__),
"addressbook.thrift"))
server = make_server(addressbook.AddressBookService, Dispatcher(),
host="127.0.0.1", port=6080)
ps = multiprocess.Process(target=server.serve)
3 changes: 2 additions & 1 deletion tests/test_multiplexed.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import
import sys

import multiprocess
import os
@@ -77,7 +78,7 @@ def client_two(timeout=3000):
socket_timeout=timeout, connect_timeout=timeout,
proto_factory=multiplexing_factory)


@pytest.mark.skipif(sys.platform == "win32", "requires socket.UNIX")
def test_multiplexed_server(server):
with client_one() as c:
assert c.doThingOne() is True