From 7a2c10b4bcbf6f69b511bada56b168e458f7ed10 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Tue, 1 Oct 2024 11:44:52 +0200 Subject: [PATCH] Test with Executorlib --- tests/test_conda_function.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_conda_function.py b/tests/test_conda_function.py index ed75f19..4c4676e 100644 --- a/tests/test_conda_function.py +++ b/tests/test_conda_function.py @@ -3,6 +3,7 @@ try: from conda_subprocess.decorator import conda + from executorlib import Executor from executorlib.shared.executor import cloudpickle_register except ImportError: @@ -33,3 +34,11 @@ def test_conda_function(self): number, prefix = add_function(parameter_1=1, parameter_2=2) self.assertEqual(prefix[-5:], "py312") self.assertEqual(number, 3) + + def test_conda_function_with_executorlib(self): + cloudpickle_register(ind=1) + with Executor(max_cores=1, backend="local", hostname_localhost=True) as exe: + future = exe.submit(add_function, 1, 2) + number, prefix = future.result() + self.assertEqual(prefix[-5:], "py312") + self.assertEqual(number, 3)