Skip to content

Commit

Permalink
selftests/hid: base: allow for multiple skip_if_uhdev
Browse files Browse the repository at this point in the history
We can actually have multiple occurences of `skip_if_uhdev` if we follow
the information from the pytest doc[0].

This is not immediately used, but can be if we need multiple conditions
on a given test.

[0] https://docs.pytest.org/en/latest/historical-notes.html#update-marker-code

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jiri Kosina <jkosina@suse.com>
Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-3-c0350c2f5986@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
  • Loading branch information
Benjamin Tissoires committed Dec 7, 2023
1 parent 46bc027 commit 110292a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tools/testing/selftests/hid/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,7 @@ def context(self, new_uhdev, request):
try:
with HIDTestUdevRule.instance():
with new_uhdev as self.uhdev:
skip_cond = request.node.get_closest_marker("skip_if_uhdev")
if skip_cond:
for skip_cond in request.node.iter_markers("skip_if_uhdev"):
test, message, *rest = skip_cond.args

if test(self.uhdev):
Expand Down

0 comments on commit 110292a

Please sign in to comment.