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

Async support? #120

Closed
souliane opened this issue Dec 16, 2024 · 3 comments · Fixed by #121
Closed

Async support? #120

souliane opened this issue Dec 16, 2024 · 3 comments · Fixed by #121

Comments

@souliane
Copy link
Contributor

Description

Hi, it looks like this does not work with IsolatedAsyncioTestCase, does it?

from unittest import IsolatedAsyncioTestCase

from unittest_parametrize import ParametrizedTestCase, parametrize


class TestAsyncParametrize(ParametrizedTestCase, IsolatedAsyncioTestCase):
    async def test_a(self) -> None:   # fails as expected
        1 / 0

    @parametrize(("arg1", "arg2"), [(1, 2)])
    async def test_x(self, arg1: int, arg2: int) -> None:  # succeeds
        1 / 0

If this is missing, could you please add it or give me some instructions so that I give it a try?

@adamchainz
Copy link
Owner

Please make a PR adding tests to the test suite, I could work with that to fix compatibility.

@adamchainz
Copy link
Owner

souliane pushed a commit to souliane/unittest-parametrize that referenced this issue Dec 30, 2024
@souliane
Copy link
Contributor Author

Sure :-)

adamchainz added a commit that referenced this issue Jan 6, 2025
Closes #120

---------

Co-authored-by: Adrien Cossa <[email protected]>
Co-authored-by: Adam Johnson <[email protected]>
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 a pull request may close this issue.

2 participants