From 9abff7f72f37b15df74a883b8cff41e9c1db5989 Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Thu, 1 Jun 2017 22:24:43 +0300 Subject: [PATCH] Add a docstring to HelpAction --- _pytest/helpconfig.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/_pytest/helpconfig.py b/_pytest/helpconfig.py index dee092b49..e3c6b6e99 100644 --- a/_pytest/helpconfig.py +++ b/_pytest/helpconfig.py @@ -9,6 +9,14 @@ from argparse import Action class HelpAction(Action): + """This is an argparse Action that will raise an exception in + order to skip the rest of the argument parsing when --help is passed. + This prevents argparse from quitting due to missing required arguments + when any are defined, for example by ``pytest_addoption``. + This is similar to the way that the builtin argparse --help option is + implemented by raising SystemExit. + """ + def __init__(self, option_strings, dest=None,