Skip to content

Commit

Permalink
tests for suppression of default
Browse files Browse the repository at this point in the history
  • Loading branch information
michele-riva committed Jun 13, 2024
1 parent 63b10dd commit 3bbe816
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/roots/test-default-html/default-suppressed.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Default suppressed
==================

.. argparse::
:filename: test/sample-default-supressed.py
:prog: sample-default-suppressed
:func: get_parser
10 changes: 10 additions & 0 deletions test/sample-default-supressed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from argparse import ArgumentParser

def get_parser():
parser = ArgumentParser(prog='sample-default-suppressed',
description='Test suppression of version default')
parser.add_argument('--version',
help='print version number',
action='version',
version='1.2.3')
return parser
9 changes: 9 additions & 0 deletions test/test_default_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@
(".//section/dl/dd/p/code/span", r"\['\*.rst',"),
],
),
(
'default-suppressed.html',
[
(".//h1", 'Sample', False),
(".//h1", 'Default suppressed'),
(".//h2", 'Named Arguments'),
(".//section/dl/dd/p", 'Default', False),
],
),
],
)
@pytest.mark.sphinx('html', testroot='default-html')
Expand Down

0 comments on commit 3bbe816

Please sign in to comment.