From c1799e6f150eb0ea9097e9e29a040278b99636ea Mon Sep 17 00:00:00 2001 From: Maxim Zhiltsov Date: Thu, 3 Jun 2021 16:45:30 +0300 Subject: [PATCH 1/2] Fix prog name --- datumaro/cli/__main__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/datumaro/cli/__main__.py b/datumaro/cli/__main__.py index 2ecf9f7a78..528c6d019e 100644 --- a/datumaro/cli/__main__.py +++ b/datumaro/cli/__main__.py @@ -5,6 +5,7 @@ import argparse import logging as log +import os.path as osp import sys from . import contexts, commands @@ -50,9 +51,11 @@ def _make_subcommands_help(commands, help_line_start=0): return desc def make_parser(): - parser = argparse.ArgumentParser(prog="datumaro", + parser = argparse.ArgumentParser( description="Dataset Framework", formatter_class=argparse.RawDescriptionHelpFormatter) + if parser.prog == osp.basename(__file__): # python -m datumaro ... + parser.prog = 'datumaro' parser.add_argument('--version', action='version', version=VERSION) _LogManager._define_loglevel_option(parser) From 603dcbb992aaebcd98b74c9685140a2f30a150bc Mon Sep 17 00:00:00 2001 From: Maxim Zhiltsov Date: Thu, 3 Jun 2021 17:27:00 +0300 Subject: [PATCH 2/2] Add mark_bug test annotation --- tests/requirements.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/requirements.py b/tests/requirements.py index 9bc8c1ad45..49ab421d62 100644 --- a/tests/requirements.py +++ b/tests/requirements.py @@ -16,6 +16,17 @@ def test_wrapper(*args, **kwargs): return test_wrapper return wrapper +def mark_bug(bugs): + def wrapper(test_func): + @pytest.mark.components(DatumaroComponent.Datumaro) + @pytest.mark.component + @pytest.mark.priority_medium + @pytest.mark.bugs(bugs) + def test_wrapper(*args, **kwargs): + return test_func(*args, **kwargs) + return test_wrapper + return wrapper + class DatumaroComponent: Datumaro = "datumaro"