-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pytestplugin/hooks: combine multiple lg_feature markers instead of ov…
…erwriting previous ones pytest allows setting markers via function decorators [1], class decorators [2] and "pytestmark" global to mark whole modules [2]. Additionally, each of these variants can specify multiple markers. labgrid's pytest plugin considered only the closest marker. Change that to allow combinations of multiple markers. This allows use cases like: import pytest pytestmark = pytest.mark.lg_feature("watchdog") @pytest.mark.lg_feature("barebox") def test_watchdog_barebox(barebox): .. Tests in this module are only run if the feature flag "watchdog" is available. The specific test "test_watchdog_barebox" is only run if the feature flag "barebox" is available additionally. [1] https://docs.pytest.org/en/latest/example/markers.html#adding-a-custom-marker-from-a-plugin [2] https://docs.pytest.org/en/latest/example/markers.html#marking-whole-classes-or-modules Signed-off-by: Bastian Krause <[email protected]>
- Loading branch information
1 parent
f465656
commit 5dc0330
Showing
3 changed files
with
78 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters