Differential D8684 Diff 40955 examples/docs_snippets/docs_snippets_tests/concepts_tests/logging_tests/test_custom.py
Changeset View
Changeset View
Standalone View
Standalone View
examples/docs_snippets/docs_snippets_tests/concepts_tests/logging_tests/test_custom.py
import yaml | import yaml | ||||
from dagster import execute_pipeline | from dagster import execute_pipeline | ||||
from dagster.utils import file_relative_path | from dagster.utils import file_relative_path | ||||
from docs_snippets.concepts.logging.custom_logger import ( | from docs_snippets.concepts.logging.custom_logger import ( | ||||
demo_pipeline, | demo_pipeline, | ||||
test_init_json_console_logger, | test_init_json_console_logger, | ||||
test_init_json_console_logger_with_context, | test_init_json_console_logger_with_context, | ||||
) | ) | ||||
def test_json_logger(): | def test_json_logger(): | ||||
with open( | with open( | ||||
file_relative_path( | file_relative_path( | ||||
__file__, "../../../docs_snippets/concepts/logging/config_custom_logger.yaml" | __file__, | ||||
"../../../docs_snippets/concepts/logging/config_custom_logger.yaml", | |||||
), | ), | ||||
"r", | "r", | ||||
) as fd: | ) as fd: | ||||
run_config = yaml.safe_load(fd.read()) | run_config = yaml.safe_load(fd.read()) | ||||
assert execute_pipeline(demo_pipeline, run_config=run_config).success | assert execute_pipeline(demo_pipeline, run_config=run_config).success | ||||
def test_testing_examples(): | def test_testing_examples(): | ||||
test_init_json_console_logger() | test_init_json_console_logger() | ||||
test_init_json_console_logger_with_context() | test_init_json_console_logger_with_context() |