From ff44453b19cbc188e7322718d15df19c12379d8a Mon Sep 17 00:00:00 2001 From: Christopher Harris Date: Wed, 25 Oct 2023 18:47:06 +0000 Subject: [PATCH] remove unused namespace and rename pycoro --- python/mrc/_pymrc/tests/coro/module.cpp | 4 ---- python/tests/{test_pycoro.py => test_coro.py} | 8 ++++---- 2 files changed, 4 insertions(+), 8 deletions(-) rename python/tests/{test_pycoro.py => test_coro.py} (93%) diff --git a/python/mrc/_pymrc/tests/coro/module.cpp b/python/mrc/_pymrc/tests/coro/module.cpp index 4d69d5a0d..df3b3ad0f 100644 --- a/python/mrc/_pymrc/tests/coro/module.cpp +++ b/python/mrc/_pymrc/tests/coro/module.cpp @@ -26,8 +26,6 @@ #include #include -namespace morpheus::tests::pycoro { - mrc::coroutines::Task subtract(int a, int b) { co_return a - b; @@ -71,5 +69,3 @@ PYBIND11_MODULE(coro, _module) _module.def("raise_at_depth_async", &raise_at_depth_async); _module.def("call_async", &call_async); } - -} // namespace morpheus::tests::pycoro diff --git a/python/tests/test_pycoro.py b/python/tests/test_coro.py similarity index 93% rename from python/tests/test_pycoro.py rename to python/tests/test_coro.py index b92b12290..485144768 100644 --- a/python/tests/test_pycoro.py +++ b/python/tests/test_coro.py @@ -19,7 +19,7 @@ from mrc._pymrc.tests.coro.coro import call_async from mrc._pymrc.tests.coro.coro import call_fib_async from mrc._pymrc.tests.coro.coro import raise_at_depth_async -from mrc.core import coro as pycoro +from mrc.core import coro @pytest.mark.asyncio @@ -31,13 +31,13 @@ async def inner(): # nonlocal hit_inside - result = await pycoro.wrap_coroutine(asyncio.sleep(1, result=['a', 'b', 'c'])) + result = await coro.wrap_coroutine(asyncio.sleep(1, result=['a', 'b', 'c'])) # hit_inside = True return [result] - returned_val = await pycoro.wrap_coroutine(inner()) + returned_val = await coro.wrap_coroutine(inner()) assert returned_val == 'a' # assert hit_inside @@ -61,7 +61,7 @@ async def inner(): return ['a', 'b', 'c'] - coros = [pycoro.wrap_coroutine(inner()) for _ in range(expected_count)] + coros = [coro.wrap_coroutine(inner()) for _ in range(expected_count)] returned_vals = await asyncio.gather(*coros)