code: def test_cannot_be_both_setup_and_teardown(dag_maker, type_):
      # can't change a setup task to a teardown task or vice versa
      for first, second in [
          ("setup", "teardown"),
          ("teardown", "setup"),
      ]:
          with dag_maker():
              s1 = make_task(name="s1", type_=type_)
              getattr(s1, f"as_{first}")()
              with pytest.raises(
                  ValueError,
                  match=f"Cannot mark task 's1' as {second}; task is already a {first}.",
              ):
                  getattr(s1, f"as_{second}")()
                  s1.as_teardown()
  
file_path: airflow/tests/models/test_taskmixin.py
imports: from __future__ import annotations
  import itertools
  import pytest
  from airflow.decorators import setup, task, teardown
  from airflow.models.baseoperator import BaseOperator
label_desc: Use image node_id 6 for calling a global function with example usage: test_cannot_be_both_setup_and_teardown(dag_maker, type_) without return types