Skip to content

Commit

Permalink
support mp spawn mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cocolato committed Apr 18, 2024
1 parent febc303 commit 1042bc6
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tests/test_all_protocols_binary_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
from thriftpy2.transport import TBufferedTransportFactory, TCyMemoryBuffer


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


protocols = [TApacheJSONProtocolFactory,
Expand Down Expand Up @@ -166,11 +164,16 @@ def test_exceptions(server_func, proto_factory):
)
TestException = test_thrift.TestException

class Handler(object):
def do_error(self, arg):
raise TestException(message=arg)

def do_server():
import thriftpy2
test_thrift = thriftpy2.load(
"apache_json_test.thrift",
module_name="test_thrift"
)
TestException = test_thrift.TestException
class Handler(object):
def do_error(self, arg):
raise TestException(message=arg)
server = server_func[0](
service=test_thrift.TestService,
handler=Handler(),
Expand Down Expand Up @@ -242,6 +245,8 @@ def test(t):
trans_factory = TBufferedTransportFactory

def run_server():
import thriftpy2
spec = thriftpy2.load("bin_test.thrift", module_name="bin_thrift")
server = make_rpc_server(
spec.BinService,
handler=Handler(),
Expand Down

0 comments on commit 1042bc6

Please sign in to comment.