https://pantsbuild.org/ logo
#development
Title
# development
b

bored-art-40741

04/10/2021, 11:44 PM
OK, now I'm into writing tests for rules! I'm using an existing test as a reference and trying to base mine off of it: https://github.com/pantsbuild/pants/blob/main/src/python/pants/backend/python/lint/black/rules_integration_test.py My issue is that I'm trying to test a non-Root rule, or I guess a non-
QueryRule
. At least, it doesn't have a directly associated
QueryRule
the way I wrote it, and I don't think it should have one. It's an intermediate rule and product used by others. Do I just need to stub in a
QueryRule
to force the
RuleRunner
to have a path from the root query to my rule?
(Looks like that works, so the only question is whether that's the best way to accomplish this)
e

enough-analyst-54434

04/10/2021, 11:57 PM
Yeah, you have to massage the graph like that for rule tests.
👍 1