Skip to content

Commit

Permalink
Test from Liam
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Nov 27, 2023
1 parent 2c616ac commit 56bc373
Showing 1 changed file with 36 additions and 0 deletions.
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())

0 comments on commit 56bc373

Please sign in to comment.