code: def test_both_end_date_and_num_given(self):
      with pytest.raises(
          Exception, match="Wait. Either specify end_date OR num"
      ):
          dates.date_range(
              datetime(2016, 1, 1),
              datetime(2016, 1, 3),
              num=2,
              delta=timedelta(seconds=1),
          )
  
file_path: airflow/tests/utils/test_dates.py
imports: from __future__ import annotations
  from datetime import datetime, timedelta
  import pendulum
  import pytest
  from dateutil.relativedelta import relativedelta
  from airflow.utils import dates, timezone
label_desc: Use image node_id 3 for calling the TestUtilsDatesDateRange obj's underlying member method code with example usage: obj.test_both_end_date_and_num_given() without return types