Skip to content

Add Winloop as a valid EventLoop#116

Merged
saghul merged 3 commits intoaio-libs:masterfrom
Vizonex:master
Mar 22, 2024
Merged

Add Winloop as a valid EventLoop#116
saghul merged 3 commits intoaio-libs:masterfrom
Vizonex:master

Conversation

@Vizonex
Copy link
Member

@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
Member Author

Vizonex commented Mar 22, 2024 via email

@Vizonex
Copy link
Member 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
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