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

FAILED pscript/tests/test_parser2.py::TestFunctions::test_async_and_await #69

Open
andreas-schwab opened this issue Dec 5, 2024 · 1 comment

Comments

@andreas-schwab
Copy link

=================================== FAILURES ===================================
______________________ TestFunctions.test_async_and_await ______________________

self = <test_parser2.TestFunctions object at 0x7f2d4a4f2e10>

def test_async_and_await(self):
    if sys.version_info < (3, 6):
        return

    foo = py2js('async def foo(): return 42\n\n')
    spam = py2js('async def spam(): print(await foo())\n\n')
    eggs = py2js('async def eggs(): return await foo()\n\n')
    js = foo + spam + eggs

    assert 'Promise' in evaljs(js + 'foo()')
    assert 'Promise' in evaljs(js + 'spam()')
    assert 'Promise' in evaljs(js + 'eggs()')

    assert '42' in evaljs(js + 'spam()')
  assert '42' not in evaljs(js + 'eggs()')

E AssertionError: assert '42' not in 'Promise { 42 }'
E
E '42' is contained here:
E Promise { 42 }
E ? ++

pscript/tests/test_parser2.py:874: AssertionError
=========================== short test summary info ============================
FAILED pscript/tests/test_parser2.py::TestFunctions::test_async_and_await - A...
============= 1 failed, 223 passed, 2 skipped in 670.27s (0:11:10) =============

According to nodejs/node#56144 this is a bug in
the test.

@almarklein
Copy link
Member

I think we should just remove the eggs-part of the test, since it no longer shows what the test is trying to show (that the promise is pending).

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

No branches or pull requests

2 participants