Skip to content

Commit

Permalink
Add doc param to unittest.make
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre committed Sep 20, 2023
1 parent 6bf7bae commit 8be7afa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/unittest.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def _impl_function_name(impl):
impl_name = impl_name.partition("<function ")[-1]
return impl_name.rpartition(">")[0]

def _make(impl, attrs = {}):
def _make(impl, attrs = {}, doc = ""):
"""Creates a unit test rule from its implementation function.
Each unit test is defined in an implementation function that must then be
Expand Down Expand Up @@ -178,6 +178,7 @@ def _make(impl, attrs = {}):
impl: The implementation function of the unit test.
attrs: An optional dictionary to supplement the attrs passed to the
unit test's `rule()` constructor.
doc: A description of the rule that can be extracted by documentation generating tools.
Returns:
A rule definition that should be stored in a global whose name ends in
Expand All @@ -188,6 +189,7 @@ def _make(impl, attrs = {}):

return rule(
impl,
doc = doc,
attrs = attrs,
_skylark_testable = True,
test = True,
Expand Down

0 comments on commit 8be7afa

Please sign in to comment.