Differential D8268 Diff 39108 python_modules/libraries/dagster-mysql/dagster_mysql_tests/conftest.py
Changeset View
Changeset View
Standalone View
Standalone View
python_modules/libraries/dagster-mysql/dagster_mysql_tests/conftest.py
import pytest | import pytest | ||||
from dagster.utils import file_relative_path | from dagster.utils import file_relative_path | ||||
from dagster.utils.test.mysql_instance import TestMySQLInstance | from dagster.utils.test.mysql_instance import TestMySQLInstance | ||||
@pytest.fixture(scope="function") | @pytest.fixture(scope="session") | ||||
def hostname(conn_string): # pylint: disable=redefined-outer-name, unused-argument | def hostname(conn_string): # pylint: disable=redefined-outer-name, unused-argument | ||||
return TestMySQLInstance.get_hostname() | return TestMySQLInstance.get_hostname() | ||||
@pytest.fixture(scope="function") | @pytest.fixture(scope="session") | ||||
def conn_string(): # pylint: disable=redefined-outer-name, unused-argument | def conn_string(): # pylint: disable=redefined-outer-name, unused-argument | ||||
with TestMySQLInstance.docker_service_up_or_skip( | with TestMySQLInstance.docker_service_up_or_skip( | ||||
file_relative_path(__file__, "docker-compose.yml"), "test-mysql-db" | file_relative_path(__file__, "docker-compose.yml"), "test-mysql-db" | ||||
) as conn_str: | ) as conn_str: | ||||
yield conn_str | yield conn_str |