From a22294dda9e6241ea9005395845628b8bdb12b48 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Sun, 1 Apr 2018 01:23:13 +0100 Subject: [PATCH] call_function_test: Fix assumption that we run as a script --- tests/call_function_test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/call_function_test.py b/tests/call_function_test.py index d66864b4..de3f1f46 100644 --- a/tests/call_function_test.py +++ b/tests/call_function_test.py @@ -64,7 +64,10 @@ class CallFunctionTest(testlib.RouterMixin, testlib.TestCase): def test_bad_return_value(self): exc = self.assertRaises(mitogen.core.StreamError, lambda: self.local.call(func_with_bad_return_value)) - self.assertEquals(exc[0], "cannot unpickle '__main__'/'CrazyType'") + self.assertEquals( + exc[0], + "cannot unpickle '%s'/'CrazyType'" % (__name__,), + ) def test_returns_dead(self): self.assertEqual(mitogen.core._DEAD, self.local.call(func_returns_dead))