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

Add tests for ai/export.py #729

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Add tests for ai/export.py #729

wants to merge 10 commits into from

Conversation

ahuang11
Copy link
Contributor

A bit more test coverage.

Bases off #727 because of dep warnings which turn into errors in tests

Copy link

codecov bot commented Oct 26, 2024

Codecov Report

Attention: Patch coverage is 89.89899% with 10 lines in your changes missing coverage. Please review.

Project coverage is 62.00%. Comparing base (73fda79) to head (98d47f7).

Files with missing lines Patch % Lines
lumen/tests/ai/test_export.py 89.24% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #729      +/-   ##
==========================================
+ Coverage   60.82%   62.00%   +1.17%     
==========================================
  Files         100      101       +1     
  Lines       12402    12500      +98     
==========================================
+ Hits         7543     7750     +207     
+ Misses       4859     4750     -109     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

from lumen.sources.intake import IntakeSource
from lumen.views import Table

loop = asyncio.new_event_loop()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is quite right, I think there's ways to configure pytest-asyncio to create the loop.

Base automatically changed from add_test_for_utils to main October 28, 2024 18:14
@ahuang11
Copy link
Contributor Author

Have you seen this traceback before?

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.pixi\envs\test-310\lib\site-packages\_pytest\runner.py:242: in <lambda>
    lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
.pixi\envs\test-310\lib\site-packages\pluggy\_hooks.py:513: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
.pixi\envs\test-310\lib\site-packages\pluggy\_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
.pixi\envs\test-310\lib\site-packages\_pytest\threadexception.py:97: in pytest_runtest_teardown
    yield from thread_exception_runtest_hook()
.pixi\envs\test-310\lib\site-packages\_pytest\threadexception.py:68: in thread_exception_runtest_hook
    yield
.pixi\envs\test-310\lib\site-packages\_pytest\unraisableexception.py:100: in pytest_runtest_teardown
    yield from unraisable_exception_runtest_hook()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def unraisable_exception_runtest_hook() -> Generator[None]:
        with catch_unraisable_exception() as cm:
            try:
                yield
            finally:
                if cm.unraisable:
                    if cm.unraisable.err_msg is not None:
                        err_msg = cm.unraisable.err_msg
                    else:
                        err_msg = "Exception ignored in"
                    msg = f"{err_msg}: {cm.unraisable.object!r}\n\n"
                    msg += "".join(
                        traceback.format_exception(
                            cm.unraisable.exc_type,
                            cm.unraisable.exc_value,
                            cm.unraisable.exc_traceback,
                        )
                    )
>                   warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
E                   pytest.PytestUnraisableExceptionWarning: Exception ignored in: <coroutine object SelectorThread.__init__.<locals>.thread_manager_anext at 0x0000020605801AF0>
E                   
E                   Traceback (most recent call last):
E                     File "D:\a\lumen\lumen\.pixi\envs\test-310\lib\warnings.py", line 506, in _warn_unawaited_coroutine
E                       warn(msg, category=RuntimeWarning, stacklevel=2, source=coro)
E                   RuntimeWarning: coroutine 'SelectorThread.__init__.<locals>.thread_manager_anext' was never awaited

Not sure how to fix the windows tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants