Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test_ipv6 to test if asyncore is present
asyncore is not present after 3.12
  • Loading branch information
dkropachev committed Dec 22, 2024
commit ba4e804e0dc6ef1bd6891ac2ebf78110cf910f06
26 changes: 16 additions & 10 deletions tests/integration/long/test_ipv6.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,25 @@
from ccmlib import common

from cassandra.cluster import NoHostAvailable
from cassandra.io.asyncorereactor import AsyncoreConnection

try:
from cassandra.io.asyncorereactor import AsyncoreConnection
except ImportError:
AsyncoreConnection = None

from tests import is_monkey_patched
from tests.integration import use_cluster, remove_cluster, TestCluster

try:
from cassandra.io.libevreactor import LibevConnection
except ImportError:
LibevConnection = None


if is_monkey_patched():
LibevConnection = -1
AsyncoreConnection = -1
else:
try:
from cassandra.io.libevreactor import LibevConnection
except ImportError:
LibevConnection = None
LibevConnection = None
AsyncoreConnection = None


import unittest

Expand Down Expand Up @@ -102,7 +108,7 @@ def setUp(self):
if os.name == "nt":
raise unittest.SkipTest("IPv6 is currently not supported under Windows")

if LibevConnection == -1:
if LibevConnection is None:
raise unittest.SkipTest("Can't test libev with monkey patching")
elif LibevConnection is None:
raise unittest.SkipTest("Libev does not appear to be installed properly")
Expand All @@ -116,5 +122,5 @@ def setUp(self):
if os.name == "nt":
raise unittest.SkipTest("IPv6 is currently not supported under Windows")

if AsyncoreConnection == -1:
if AsyncoreConnection is None:
raise unittest.SkipTest("Can't test asyncore with monkey patching")
Loading