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

Test from Liam #236

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
36 changes: 36 additions & 0 deletions tests/test_liam.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from unittest import TestCase
from pympipool import PyMPIExecutor


def add_two(x):
return x + 2


class TestPyMPIExecutor(TestCase):

def test_local(self):
# Works perfectly
def add_one(x):
return x + 1

class Foo:
def add(self, x):
return add_one(x)

foo = Foo()
executor = PyMPIExecutor()
fs = executor.submit(foo.add, 1)
self.assertEqual(2, fs.result())

def test_semi_local(self):
# Hangs
# CI logs make it look like cloudpickle is trying to import from this module,
# but can't find it
class Foo:
def add(self, x):
return add_two(x)

foo = Foo()
executor = PyMPIExecutor()
fs = executor.submit(foo.add, 1)
self.assertEqual(3, fs.result())
Loading