code: def test_import_url_to_remote_flag(dvc, mocker, caplog):
      cli_args = parse_args(
          ["import-url", "s3://bucket/foo", "bar", "--remote", "remote"]
      )
  
      cmd = cli_args.func(cli_args)
      with caplog.at_level(logging.ERROR, logger="dvc"):
          assert cmd.run() == 1
          expected_msg = "--remote can't be used without --to-remote"
          assert expected_msg in caplog.text
  
file_path: dvc/tests/unit/command/test_imp_url.py
imports: import logging
  import pytest
  from dvc.cli import parse_args
  from dvc.commands.imp_url import CmdImportUrl
  from dvc.exceptions import DvcException
label_desc: Use image node_id 6 for calling a global function with example usage: test_import_url_to_remote_flag(dvc, mocker, caplog) without return types