title: Airflow dag_id did not exist or it failed to parse
body: <p>currently im learning how to use Apache Airflow and trying to create a simple DAG script like this</p>
  
  <pre><code>from datetime import datetime
  from airflow import DAG
  from airflow.operators.dummy_operator import DummyOperator
  from airflow.operators.python_operator import PythonOperator
  
  def print_hello():
      return 'Hello world!'
  
  dag = DAG('hello_world', description='Simple tutorial DAG',
            schedule_interval='0 0 * * *',
            start_date=datetime(2020, 5, 23), catchup=False)
  
  dummy_operator = DummyOperator(task_id='dummy_task', retries=3, dag=dag)
  
  hello_operator = PythonOperator(task_id='hello_task', python_callable=print_hello, dag=dag)
  
  dummy_operator &gt;&gt; hello_operator
  </code></pre>
  
  <p>i run those DAG using web server and run succesfully even checked the logs</p>
  
  <pre><code>[2020-05-23 20:43:53,411] {taskinstance.py:669} INFO - Dependencies all met for &lt;TaskInstance: hello_world.hello_task 2020-05-23T13:42:17.463955+00:00 [queued]&gt;
  [2020-05-23 20:43:53,431] {taskinstance.py:669} INFO - Dependencies all met for &lt;TaskInstance: hello_world.hello_task 2020-05-23T13:42:17.463955+00:00 [queued]&gt;
  [2020-05-23 20:43:53,432] {taskinstance.py:879} INFO - 
  --------------------------------------------------------------------------------
  [2020-05-23 20:43:53,432] {taskinstance.py:880} INFO - Starting attempt 1 of 1
  [2020-05-23 20:43:53,432] {taskinstance.py:881} INFO - 
  --------------------------------------------------------------------------------
  [2020-05-23 20:43:53,448] {taskinstance.py:900} INFO - Executing &lt;Task(PythonOperator): hello_task&gt; on 2020-05-23T13:42:17.463955+00:00
  [2020-05-23 20:43:53,477] {standard_task_runner.py:53} INFO - Started process 7442 to run task
  [2020-05-23 20:43:53,685] {logging_mixin.py:112} INFO - Running %s on host %s &lt;TaskInstance: hello_world.hello_task 2020-05-23T13:42:17.463955+00:00 [running]&gt; LAPTOP-9BCTKM5O.localdomain
  [2020-05-23 20:43:53,715] {python_operator.py:114} INFO - Done. Returned value was: Hello world!
  [2020-05-23 20:43:53,738] {taskinstance.py:1052} INFO - Marking task as SUCCESS.dag_id=hello_world, task_id=hello_task, execution_date=20200523T134217, start_date=20200523T134353, end_date=20200523T134353
  [2020-05-23 20:44:03,372] {logging_mixin.py:112} INFO - [2020-05-23 20:44:03,372] {local_task_job.py:103} INFO - Task exited with return code 0
  </code></pre>
  
  <p>but when i tried to test run a single task using this command</p>
  
  <pre><code>airflow test dags/main.py hello_task 2020-05-23
  </code></pre>
  
  <p>it shows this error</p>
  
  <pre><code>airflow.exceptions.AirflowException: dag_id could not be found: dags/main.py. Either the dag did not exist or it failed to parse.
  </code></pre>
  
  <p>where i went wrong ?</p>