Skip to content

Commit

Permalink
Renamed variables in the integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nusnus committed Oct 24, 2023
1 parent d774c55 commit 145f486
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 63 deletions.
16 changes: 8 additions & 8 deletions tests/integration/api/test_backend.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import pytest
from pytest_lazyfixture import lazy_fixture

from pytest_celery import CELERY_BACKEND
from pytest_celery import CELERY_BACKEND_CLUSTER
from pytest_celery import CeleryBackendCluster
from pytest_celery import CeleryTestBackend
from tests.defaults import CELERY_BACKEND
from tests.defaults import CELERY_BACKEND_CLUSTER


@pytest.mark.parametrize("node", [lazy_fixture(CELERY_BACKEND)])
@pytest.mark.parametrize("backend", [lazy_fixture(CELERY_BACKEND)])
class test_celey_test_backend:
def test_app(self, node: CeleryTestBackend):
assert node.app is None
def test_app(self, backend: CeleryTestBackend):
assert backend.app is None


@pytest.mark.parametrize("cluster", [lazy_fixture(CELERY_BACKEND_CLUSTER)])
class test_celery_backend_cluster:
def test_app(self, cluster: CeleryBackendCluster):
node: CeleryTestBackend
for node in cluster:
assert node.app is None
backend: CeleryTestBackend
for backend in cluster:
assert backend.app is None
16 changes: 8 additions & 8 deletions tests/integration/api/test_broker.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import pytest
from pytest_lazyfixture import lazy_fixture

from pytest_celery import CELERY_BROKER
from pytest_celery import CELERY_BROKER_CLUSTER
from pytest_celery import CeleryBrokerCluster
from pytest_celery import CeleryTestBroker
from tests.defaults import CELERY_BROKER
from tests.defaults import CELERY_BROKER_CLUSTER


@pytest.mark.parametrize("node", [lazy_fixture(CELERY_BROKER)])
@pytest.mark.parametrize("broker", [lazy_fixture(CELERY_BROKER)])
class test_celery_test_broker:
def test_app(self, node: CeleryTestBroker):
assert node.app is None
def test_app(self, broker: CeleryTestBroker):
assert broker.app is None


@pytest.mark.parametrize("cluster", [lazy_fixture(CELERY_BROKER_CLUSTER)])
class test_celery_broker_cluster:
def test_app(self, cluster: CeleryBrokerCluster):
node: CeleryTestBroker
for node in cluster:
assert node.app is None
broker: CeleryTestBroker
for broker in cluster:
assert broker.app is None
28 changes: 14 additions & 14 deletions tests/integration/api/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@
from tests.integration.conftest import IntegrationWorkerContainer


@pytest.mark.parametrize("node", [lazy_fixture(CELERY_WORKER)])
@pytest.mark.parametrize("worker", [lazy_fixture(CELERY_WORKER)])
class test_celey_test_worker:
def test_app(self, node: CeleryTestWorker, celery_setup_app: Celery):
assert node.app is celery_setup_app
def test_app(self, worker: CeleryTestWorker, celery_setup_app: Celery):
assert worker.app is celery_setup_app

def test_version(self, node: CeleryTestWorker):
assert node.version == CeleryWorkerContainer.version()
def test_version(self, worker: CeleryTestWorker):
assert worker.version == CeleryWorkerContainer.version()

def test_wait_for_log(self, node: CeleryTestWorker):
log = f"{IntegrationWorkerContainer.worker_name()}@{node.hostname()} v{node.version}"
node.wait_for_log(log, "test_celey_test_worker.test_wait_for_log")
def test_wait_for_log(self, worker: CeleryTestWorker):
log = f"{IntegrationWorkerContainer.worker_name()}@{worker.hostname()} v{worker.version}"
worker.wait_for_log(log, "test_celey_test_worker.test_wait_for_log")

def test_assert_log_exists(self, node: CeleryTestWorker):
log = f"{IntegrationWorkerContainer.worker_name()}@{node.hostname()} v{node.version}"
node.assert_log_exists(log, "test_celey_test_worker.test_assert_log_exists")
def test_assert_log_exists(self, worker: CeleryTestWorker):
log = f"{IntegrationWorkerContainer.worker_name()}@{worker.hostname()} v{worker.version}"
worker.assert_log_exists(log, "test_celey_test_worker.test_assert_log_exists")


@pytest.mark.parametrize("cluster", [lazy_fixture(CELERY_WORKER_CLUSTER)])
class test_celery_worker_cluster:
def test_app(self, cluster: CeleryWorkerCluster, celery_setup_app: Celery):
node: CeleryTestWorker
for node in cluster:
assert node.app is celery_setup_app
worker: CeleryTestWorker
for worker in cluster:
assert worker.app is celery_setup_app

def test_versions(self, cluster: CeleryWorkerCluster):
assert cluster.versions == {CeleryWorkerContainer.version()}
14 changes: 7 additions & 7 deletions tests/integration/vendors/test_memcached.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import pytest
from pytest_lazyfixture import lazy_fixture

# from pytest_celery import CELERY_MEMCACHED_BACKEND
from pytest_celery import CELERY_MEMCACHED_BACKEND
from pytest_celery import MemcachedContainer

# from pytest_celery import MemcachedTestBackend
from pytest_celery import MemcachedTestBackend
from tests.defaults import ALL_MEMCACHED_FIXTURES


Expand All @@ -22,7 +21,8 @@ def test_celeryconfig(self, container: MemcachedContainer):
assert set(container.celeryconfig.keys()) == expected_keys


# @pytest.mark.parametrize("node", [lazy_fixture(CELERY_MEMCACHED_BACKEND)])
# class test_memcached_test_backend:
# def test_placeholder(self, node: MemcachedTestBackend):
# node = node
@pytest.mark.parametrize("backend", [lazy_fixture(CELERY_MEMCACHED_BACKEND)])
class test_memcached_test_backend:
@pytest.mark.skip("Placeholder")
def test_placeholder(self, backend: MemcachedTestBackend):
backend = backend
14 changes: 7 additions & 7 deletions tests/integration/vendors/test_rabbitmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
from kombu import Connection
from pytest_lazyfixture import lazy_fixture

# from pytest_celery import CELERY_RABBITMQ_BROKER
from pytest_celery import CELERY_RABBITMQ_BROKER
from pytest_celery import RabbitMQContainer

# from pytest_celery import RabbitMQTestBroker
from pytest_celery import RabbitMQTestBroker
from tests.defaults import ALL_RABBITMQ_FIXTURES


Expand All @@ -24,7 +23,8 @@ def test_celeryconfig(self, container: RabbitMQContainer):
assert set(container.celeryconfig.keys()) == expected_keys


# @pytest.mark.parametrize("node", [lazy_fixture(CELERY_RABBITMQ_BROKER)])
# class test_rabbitmq_test_broker:
# def test_placeholder(self, node: RabbitMQTestBroker):
# node = node
@pytest.mark.parametrize("broker", [lazy_fixture(CELERY_RABBITMQ_BROKER)])
class test_rabbitmq_test_broker:
@pytest.mark.skip("Placeholder")
def test_placeholder(self, broker: RabbitMQTestBroker):
broker = broker
27 changes: 14 additions & 13 deletions tests/integration/vendors/test_redis.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import pytest
from pytest_lazyfixture import lazy_fixture

# from pytest_celery import CELERY_REDIS_BACKEND
# from pytest_celery import CELERY_REDIS_BROKER
from pytest_celery import CELERY_REDIS_BACKEND
from pytest_celery import CELERY_REDIS_BROKER
from pytest_celery import RedisContainer

# from pytest_celery import RedisTestBackend
# from pytest_celery import RedisTestBroker
from pytest_celery import RedisTestBackend
from pytest_celery import RedisTestBroker
from tests.defaults import ALL_REDIS_FIXTURES


Expand All @@ -24,13 +23,15 @@ def test_celeryconfig(self, container: RedisContainer):
assert set(container.celeryconfig.keys()) == expected_keys


# @pytest.mark.parametrize("node", [lazy_fixture(CELERY_REDIS_BACKEND)])
# class test_redis_test_backend:
# def test_placeholder(self, node: RedisTestBackend):
# node = node
@pytest.mark.parametrize("backend", [lazy_fixture(CELERY_REDIS_BACKEND)])
class test_redis_test_backend:
@pytest.mark.skip("Placeholder")
def test_placeholder(self, backend: RedisTestBackend):
backend = backend


# @pytest.mark.parametrize("node", [lazy_fixture(CELERY_REDIS_BROKER)])
# class test_redis_test_broker:
# def test_placeholder(self, node: RedisTestBroker):
# node = node
@pytest.mark.parametrize("broker", [lazy_fixture(CELERY_REDIS_BROKER)])
class test_redis_test_broker:
@pytest.mark.skip("Placeholder")
def test_placeholder(self, broker: RedisTestBroker):
broker = broker
13 changes: 7 additions & 6 deletions tests/integration/vendors/test_worker.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import pytest
from pytest_lazyfixture import lazy_fixture

# from pytest_celery import CELERY_SETUP_WORKER
# from pytest_celery import CeleryTestWorker
from pytest_celery import CELERY_SETUP_WORKER
from pytest_celery import CeleryTestWorker
from pytest_celery import CeleryWorkerContainer
from tests.defaults import ALL_WORKERS_FIXTURES

Expand All @@ -18,7 +18,8 @@ def test_celeryconfig(self, container: CeleryWorkerContainer):
container.celeryconfig


# @pytest.mark.parametrize("node", [lazy_fixture(CELERY_SETUP_WORKER)])
# class test_base_test_worker:
# def test_placeholder(self, node: CeleryTestWorker):
# node = node
@pytest.mark.parametrize("worker", [lazy_fixture(CELERY_SETUP_WORKER)])
class test_base_test_worker:
@pytest.mark.skip("Placeholder")
def test_placeholder(self, worker: CeleryTestWorker):
worker = worker

0 comments on commit 145f486

Please sign in to comment.