<#21785 `rule_runner.do_not_use_mock` has issues w...
# github-notifications
c
#21785 `rule_runner.do_not_use_mock` has issues with call-by-name rule calls Issue created by ndellosa95 Describe the bug \nI have a plugin where I use the call-by-name syntax in certain spots where I know the name of the rule call (primarily calls to other rules in the same plugin). I'm working on unit tests for said plugin, and I've run into this when attempting to use
rule_runner.do_not_use_mock
on these rules that are invoked by name.\n\n/Users/nicholas.dellosa/.cache/pants/named_caches/pex_root/venvs/0/s/8d8cc688/venv/lib/python3.9/site-packages/pants/testutil/rule_runner.py776 in run_rule_with_mocks\n rule_input = [get(g) for g in res] # type: ignore[union-attr]\n/Users/nicholas.dellosa/.cache/pants/named_caches/pex_root/venvs/0/s/8d8cc688/venv/lib/python3.9/site-packages/pants/testutil/rule_runner.py776 in <listcomp>\n rule_input = [get(g) for g in res] # type: ignore[union-attr]\n/Users/nicholas.dellosa/.cache/pants/named_caches/pex_root/venvs/0/s/8d8cc688/venv/lib/python3.9/site-packages/pants/testutil/rule_runner.py744 in get\n provider = next(\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\n.0 = <list_iterator object at 0x113375c40>\n\n (\n mock_get.mock\n for mock_get in mock_gets\n> if mock_get.output_type == res.output_type\n and all(\n type(val) in mock_get.input_types\n or (\n union_membership\n and any(\n input_type in union_membership\n and union_membership.is_member(input_type, val)\n for input_type in mock_get.input_types\n )\n )\n for val in res.inputs\n )\n ),\n None,\n )\nE AttributeError: 'coroutine' object has no attribute 'output_type'\n\n*Pants version* \n2.23.0\n\n*OS* \nMacOS pantsbuild/pants