Skip to content

Commit ccf6347

Browse files
committed
tests: handle DependencyException
some eventloops if fail to be imported, now raises this new `DependencyException`, and test should be able to be skipped based on that
1 parent 758f9c5 commit ccf6347

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/unit/io/test_asyncorereactor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515

1616
from mock import patch
1717
import socket
18+
19+
from cassandra import DependencyException
1820
try:
1921
import cassandra.io.asyncorereactor as asyncorereactor
2022
from cassandra.io.asyncorereactor import AsyncoreConnection
2123
ASYNCCORE_AVAILABLE = True
22-
except ImportError:
24+
except (ImportError, DependencyException):
2325
ASYNCCORE_AVAILABLE = False
2426
AsyncoreConnection = None
2527

tests/unit/io/test_libevreactor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@
2121
from tests.unit.io.utils import ReactorTestMixin, TimerTestMixin, noop_if_monkey_patched
2222

2323

24+
from cassandra import DependencyException
2425
try:
2526
from cassandra.io.libevreactor import _cleanup as libev__cleanup
2627
from cassandra.io.libevreactor import LibevConnection
27-
except ImportError:
28+
except (ImportError, DependencyException):
2829
LibevConnection = None # noqa
2930

3031

0 commit comments

Comments
 (0)