Created
October 26, 2020 07:01
-
-
Save fruch/851a0ba0065cbb7da7f0204d9f6e0ad7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
@pytest.fixture(scope="module") | |
def docker_cluster(): | |
print("create docker") | |
yield "Docker Cluster" | |
print("killing docker") | |
@pytest.fixture(scope="module") | |
def reloc_cluster(): | |
print("create reloc") | |
yield "Reloc Cluster" | |
print("killing reloc") | |
@pytest.fixture | |
def cluster(request): | |
return request.getfixturevalue(request.param) | |
cluster_params = pytest.mark.parametrize( | |
'cluster', | |
('docker_cluster', 'reloc_cluster'), | |
indirect=True | |
) | |
@cluster_params | |
def test_using_same_cluster(cluster): | |
print(cluster) | |
@cluster_params | |
def test_using_same_cqlsh(cluster): | |
print(cluster) | |
@cluster_params | |
def test_using_same_nodetool(cluster): | |
print(cluster) | |
if __name__ == "__main__": | |
pytest.main([__file__]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment