Skip to content

Commit

Permalink
remove unused namespace and rename pycoro
Browse files Browse the repository at this point in the history
  • Loading branch information
cwharris committed Oct 25, 2023
1 parent 4822967 commit ff44453
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions python/mrc/_pymrc/tests/coro/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include <coroutine>
#include <stdexcept>

namespace morpheus::tests::pycoro {

mrc::coroutines::Task<int> subtract(int a, int b)
{
co_return a - b;
Expand Down Expand Up @@ -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
8 changes: 4 additions & 4 deletions python/tests/test_pycoro.py → python/tests/test_coro.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)

Expand Down

0 comments on commit ff44453

Please sign in to comment.