forked from apache/cassandra-python-driver
-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathconftest.py
More file actions
32 lines (24 loc) · 1 KB
/
conftest.py
File metadata and controls
32 lines (24 loc) · 1 KB
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
26
27
28
29
30
31
32
import os
import logging
import pytest
from ccmlib.cluster_factory import ClusterFactory as CCMClusterFactory
from tests.integration import teardown_package
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', 'shared_aware', 'sni_proxy', 'test_ip_change', 'test_client_routes_replacement']:
try:
cluster = CCMClusterFactory.load(ccm_path, cluster_name)
logging.debug("Using external CCM cluster {0}".format(cluster.name))
cluster.clear()
except FileNotFoundError:
pass
@pytest.fixture(scope='session', autouse=True)
def setup_and_teardown_packages():
print('setup')
yield
teardown_package()