forked from datastax/python-driver
-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathconftest.py
25 lines (19 loc) · 968 Bytes
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import os
import logging
import pytest
from ccmlib.cluster_factory import ClusterFactory as CCMClusterFactory
from . import CLUSTER_NAME, SINGLE_NODE_CLUSTER_NAME, MULTIDC_CLUSTER_NAME
from . import path as ccm_path
@pytest.fixture(scope="session", autouse=True)
def cleanup_clusters():
yield
if not os.environ.get('DISABLE_CLUSTER_CLEANUP'):
for cluster_name in [CLUSTER_NAME, SINGLE_NODE_CLUSTER_NAME, MULTIDC_CLUSTER_NAME, 'cluster_tests', 'ipv6_test_cluster',
'shared_aware', 'sni_proxy', 'test_ip_change', 'tablets', 'test_down_then_removed',
'test_concurrent_schema_change_and_node_kill', 'test_down_then_removed']:
try:
cluster = CCMClusterFactory.load(ccm_path, cluster_name)
logging.debug("Using external CCM cluster {0}".format(cluster.name))
cluster.clear()
except FileNotFoundError:
pass