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 Winloop as a valid EventLoop #116

Merged
merged 3 commits into from
Mar 22, 2024
Merged

Add Winloop as a valid EventLoop #116

merged 3 commits into from
Mar 22, 2024

Conversation

Vizonex
Copy link
Contributor

@Vizonex Vizonex commented Mar 21, 2024

So I recently tried to see if winloop would be another valid option since it is not tied to the ProctorEventLoop in any way shape or form and I was able to spin up a quick unittest once I modified aiodns's dns resolver to work with my library.

try:
    import aiodns
except ImportError:
    skip_tests = True
else:
    skip_tests = False

import asyncio
import sys
import unittest
import weakref

from winloop import _testbase as tb


class _TestAiodns:
    def test_dns_query(self):
        # This is not allowed to fail...
        resolver = aiodns.DNSResolver(loop=self.loop)

        async def test():
            async def query(name, query_type):
                return await resolver.query(name, query_type)
            await query('google.com', 'A')
            await query('httpbin.org', 'A')
            await query('example.com', 'A')

        self.loop.run_until_complete(test())


@unittest.skipIf(skip_tests, "no aiodns module")
class Test_UV_Aiodns(_TestAiodns, tb.UVTestCase):
    pass


@unittest.skip("aiodns needs a SelectorEventLoop on Windows. See more: https://github.com/saghul/aiodns/issues/86")
class Test_AIO_Aiodns(_TestAiodns, tb.AIOTestCase):
    pass

btw I am the main developer of winloop.

@saghul
Copy link
Contributor

saghul commented Mar 21, 2024

Nice! Could you add a test here that runs on winloop?

@Vizonex
Copy link
Contributor Author

Vizonex commented Mar 22, 2024 via email

@Vizonex
Copy link
Contributor Author

Vizonex commented Mar 22, 2024

One Little thing I added was also uvloop which works on other platforms excluding windows might be smart to add so I included it.

Copy link
Contributor

@saghul saghul left a comment

Choose a reason for hiding this comment

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

Thank you!

@saghul saghul merged commit d40f913 into aio-libs:master Mar 22, 2024
19 checks passed
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