mik-laj commented on a change in pull request #8884: URL: https://github.com/apache/airflow/pull/8884#discussion_r426124472
########## File path: tests/test_logging_config.py ########## @@ -128,43 +128,41 @@ def settings_context(content, directory=None, name='LOGGING_CONFIG'): :param content: The content of the settings file """ - initial_logging_config = os.environ.get("AIRFLOW__LOGGING__LOGGING_CONFIG_CLASS", "") - try: - settings_root = tempfile.mkdtemp() - filename = f"{SETTINGS_DEFAULT_NAME}.py" - if directory: - # Replace slashes by dots - module = directory.replace('/', '.') + '.' + SETTINGS_DEFAULT_NAME + '.' + name - - # Create the directory structure - dir_path = os.path.join(settings_root, directory) - pathlib.Path(dir_path).mkdir(parents=True, exist_ok=True) - - # Add the __init__ for the directories - # This is required for Python 2.7 - basedir = settings_root - for part in directory.split('/'): - open(os.path.join(basedir, '__init__.py'), 'w').close() - basedir = os.path.join(basedir, part) + # initial_logging_config = os.environ.get("AIRFLOW__LOGGING__LOGGING_CONFIG_CLASS", "") + # try: + settings_root = tempfile.mkdtemp() + filename = f"{SETTINGS_DEFAULT_NAME}.py" + if directory: + # Replace slashes by dots + module = directory.replace('/', '.') + '.' + SETTINGS_DEFAULT_NAME + '.' + name + # breakpoint() Review comment: Can you remove it? ########## File path: tests/test_logging_config.py ########## @@ -128,43 +128,41 @@ def settings_context(content, directory=None, name='LOGGING_CONFIG'): :param content: The content of the settings file """ - initial_logging_config = os.environ.get("AIRFLOW__LOGGING__LOGGING_CONFIG_CLASS", "") - try: - settings_root = tempfile.mkdtemp() - filename = f"{SETTINGS_DEFAULT_NAME}.py" - if directory: - # Replace slashes by dots - module = directory.replace('/', '.') + '.' + SETTINGS_DEFAULT_NAME + '.' + name - - # Create the directory structure - dir_path = os.path.join(settings_root, directory) - pathlib.Path(dir_path).mkdir(parents=True, exist_ok=True) - - # Add the __init__ for the directories - # This is required for Python 2.7 - basedir = settings_root - for part in directory.split('/'): - open(os.path.join(basedir, '__init__.py'), 'w').close() - basedir = os.path.join(basedir, part) + # initial_logging_config = os.environ.get("AIRFLOW__LOGGING__LOGGING_CONFIG_CLASS", "") + # try: Review comment: Can you remove it? ########## File path: tests/test_logging_config.py ########## @@ -128,43 +128,41 @@ def settings_context(content, directory=None, name='LOGGING_CONFIG'): :param content: The content of the settings file """ - initial_logging_config = os.environ.get("AIRFLOW__LOGGING__LOGGING_CONFIG_CLASS", "") - try: - settings_root = tempfile.mkdtemp() - filename = f"{SETTINGS_DEFAULT_NAME}.py" - if directory: - # Replace slashes by dots - module = directory.replace('/', '.') + '.' + SETTINGS_DEFAULT_NAME + '.' + name - - # Create the directory structure - dir_path = os.path.join(settings_root, directory) - pathlib.Path(dir_path).mkdir(parents=True, exist_ok=True) - - # Add the __init__ for the directories - # This is required for Python 2.7 - basedir = settings_root - for part in directory.split('/'): - open(os.path.join(basedir, '__init__.py'), 'w').close() - basedir = os.path.join(basedir, part) + # initial_logging_config = os.environ.get("AIRFLOW__LOGGING__LOGGING_CONFIG_CLASS", "") + # try: + settings_root = tempfile.mkdtemp() + filename = f"{SETTINGS_DEFAULT_NAME}.py" + if directory: + # Replace slashes by dots + module = directory.replace('/', '.') + '.' + SETTINGS_DEFAULT_NAME + '.' + name + # breakpoint() + + # Create the directory structure + dir_path = os.path.join(settings_root, directory) + pathlib.Path(dir_path).mkdir(parents=True, exist_ok=True) + + # Add the __init__ for the directories + # This is required for Python 2.7 + basedir = settings_root + for part in directory.split('/'): open(os.path.join(basedir, '__init__.py'), 'w').close() + basedir = os.path.join(basedir, part) + open(os.path.join(basedir, '__init__.py'), 'w').close() - settings_file = os.path.join(dir_path, filename) - else: - module = SETTINGS_DEFAULT_NAME + '.' + name - settings_file = os.path.join(settings_root, filename) + settings_file = os.path.join(dir_path, filename) + else: + module = SETTINGS_DEFAULT_NAME + '.' + name + # breakpoint() Review comment: Can you remove it? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org