diff options
author | Thomas Van Lenten <thomasvl@google.com> | 2018-05-01 14:12:52 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-01 14:12:52 -0400 |
commit | c8dae2702fc905bc0678c359ea092f6c0c88f765 (patch) | |
tree | 7251eaa28a7b2c141796572113dc0f878759adaf /tests | |
parent | 2d356cf8574b33d322422c561b6c811187d59a08 (diff) | |
download | bazel-skylib-c8dae2702fc905bc0678c359ea092f6c0c88f765.tar.gz |
Address skylint warnings on the tests. (#39)
* Skylint: Move comment out of docstring.
Is skylint seems more than a single like docstring, it expect a full comment
with Args/Returns/etc.; avoid having to have full docstring but just making
the comment a comment and not part of the docstring.
* Address some skylint issues.
- ctx.file_action -> ctx.actions.write
- Return an empty list of providers rather then an old style empty struct.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/new_sets_tests.bzl | 11 | ||||
-rw-r--r-- | tests/sets_tests.bzl | 9 | ||||
-rw-r--r-- | tests/shell_tests.bzl | 6 |
3 files changed, 12 insertions, 14 deletions
diff --git a/tests/new_sets_tests.bzl b/tests/new_sets_tests.bzl index 214d1c2..5734fb7 100644 --- a/tests/new_sets_tests.bzl +++ b/tests/new_sets_tests.bzl @@ -18,12 +18,11 @@ load("//:lib.bzl", "new_sets", "asserts", "unittest") def _is_equal_test(ctx): - """Unit tests for new_sets.is_equal. + """Unit tests for new_sets.is_equal.""" - Note that if this test fails, the results for the other `sets` tests will be - inconclusive because they use `asserts.new_set_equals`, which in turn calls - `new_sets.is_equal`. - """ + # Note that if this test fails, the results for the other `sets` tests will + # be inconclusive because they use `asserts.new_set_equals`, which in turn + # calls `new_sets.is_equal`. env = unittest.begin(ctx) asserts.true(env, new_sets.is_equal(new_sets.make(), new_sets.make())) @@ -264,4 +263,4 @@ def new_sets_test_suite(): contains_test, length_test, remove_test, - )
\ No newline at end of file + ) diff --git a/tests/sets_tests.bzl b/tests/sets_tests.bzl index 8c64396..bddab69 100644 --- a/tests/sets_tests.bzl +++ b/tests/sets_tests.bzl @@ -18,12 +18,11 @@ load("//:lib.bzl", "sets", "asserts", "unittest") def _is_equal_test(ctx): - """Unit tests for sets.is_equal. + """Unit tests for sets.is_equal.""" - Note that if this test fails, the results for the other `sets` tests will be - inconclusive because they use `asserts.set_equals`, which in turn calls - `sets.is_equal`. - """ + # Note that if this test fails, the results for the other `sets` tests will + # be inconclusive because they use `asserts.set_equals`, which in turn calls + # `sets.is_equal`. env = unittest.begin(ctx) asserts.true(env, sets.is_equal([], [])) diff --git a/tests/shell_tests.bzl b/tests/shell_tests.bzl index 5e8c280..24288a1 100644 --- a/tests/shell_tests.bzl +++ b/tests/shell_tests.bzl @@ -85,12 +85,12 @@ def _shell_spawn_e2e_test_impl(ctx): "line tab\tcharacter $foo qu\"o\"te it'\\''s foo\\bar back`echo q`uote'", '[[ "${output}" == "${expected}" ]]', ]) - ctx.file_action( + ctx.actions.write( output = ctx.outputs.executable, content = script_content, - executable = True, + is_executable = True, ) - return struct() + return [] shell_spawn_e2e_test = rule( test = True, |