-
Notifications
You must be signed in to change notification settings - Fork 352
Open
Labels
Description
Say I write the following in the docs:
The ``tag`` method is unusual for a Workplane method in that it returns the same Workplane object, not a new one.
Immediately after that I would like to write a test like
a = cq.Workplane()
b = a.tag("_")
assert a == b
Now if that test ever fails, I can fix my statement in the docs that I have long since forgot because I have the attention span of a caffeinated chipmunk.
If we created a directive in docs/cq_directive
called cq_test
that instructed Sphinx to just do nothing with the content (ie. no output in docs), then we could collect them during testing like we currently do for the cadquery
directive here:
cadquery/tests/test_examples.py
Line 39 in 3cb7237
directives.register_directive("cadquery", dummy_cq_directive) |
by adding the line:
directives.register_directive("cq_test", dummy_cq_directive)
and now my RST would be:
The ``tag`` method is unusual for a Workplane method in that it returns the same Workplane object, not a new one.
.. cq_test::
a = cq.Workplane()
b = a.tag("_")
assert a == b
and pytest would run that test.
Does all that sound good?