Ackerley Tng created AIRFLOW-6673:
-------------------------------------

             Summary: Calling __init__ of BaseSensorOperator turns off logging?
                 Key: AIRFLOW-6673
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-6673
             Project: Apache Airflow
          Issue Type: Bug
          Components: logging
    Affects Versions: 1.10.7
            Reporter: Ackerley Tng


Not sure if the issue lies with pytest or with airflow, but with this code
{code:python}
from airflow.sensors.base_sensor_operator import BaseSensorOperator
from airflow.utils.decorators import apply_defaults

class TestSensor(BaseSensorOperator):
    def __init__(self, *args, **kwargs):
        # super(TestSensor, self).__init__(*args, **kwargs)
        self.log.warning("Should appear")

def test_caplog(caplog):
    TestSensor(task_id="placeholder")

    assert caplog.records{code}
 The test passes if the super() call is commented out, but fails once it is 
uncommented

Hope someone more familiar with airflow can help me out!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to