Skip to content

Commit

Permalink
Skip tests that fail on Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
carlwgeorge committed Sep 21, 2023
1 parent 1dd40f1 commit 9de59b0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
22 changes: 15 additions & 7 deletions tests/test_aiohttp.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
try:
import aiohttp
import aiohttp.web
except ImportError:
import sys

if sys.version_info[:3] >= (3, 12, 0):
skip_tests = True
skip_reason = "tests fail on Python 3.12"
else:
skip_tests = False
try:
import aiohttp
import aiohttp.web
except ImportError:
skip_tests = True
skip_reason = "no aiohttp module"
else:
skip_tests = False
skip_reason = ""

import asyncio
import unittest
Expand Down Expand Up @@ -101,11 +109,11 @@ async def stop():
self.loop.run_until_complete(stop())


@unittest.skipIf(skip_tests, "no aiohttp module")
@unittest.skipIf(skip_tests, skip_reason)
class Test_UV_AioHTTP(_TestAioHTTP, tb.UVTestCase):
pass


@unittest.skipIf(skip_tests, "no aiohttp module")
@unittest.skipIf(skip_tests, skip_reason)
class Test_AIO_AioHTTP(_TestAioHTTP, tb.AIOTestCase):
pass
2 changes: 2 additions & 0 deletions tests/test_tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import select
import socket
import unittest
import unittest.mock
import ssl
import sys
Expand Down Expand Up @@ -1264,6 +1265,7 @@ def resume_writing(self):
self.loop.run_until_complete(client(srv.addr))


@unittest.skipIf(sys.version_info[:3] >= (3, 12, 0), "test fails on Python 3.12")
class Test_AIO_TCP(_TestTCP, tb.AIOTestCase):
pass

Expand Down
1 change: 1 addition & 0 deletions tests/test_unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ async def test():
self.assertEqual(recvd, b'a' * (SIZE + 1))


@unittest.skipIf(sys.version_info[:3] >= (3, 12, 0), "test fails on Python 3.12")
class Test_AIO_Unix(_TestUnix, tb.AIOTestCase):
pass

Expand Down

0 comments on commit 9de59b0

Please sign in to comment.