File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ ${MESSAGE} Hello,
1111*** Test Cases ***
1212First Test
1313 [Documentation] Thorough and relatively lengthy documentation for the example test case that
14- ... logs ${MESSAGE} and ${NAD} and ${NAMES}.
14+ ... logs ${MESSAGE} and ${NAD} and ${NAMES}. %{RUNTIME_VAR}
1515 [Tags] SWRQT-SOME_RQT ANOTHER-TAG SWRQT-OTHER_RQT SYSRQT-SOME_SYSTEM_RQT
1616 Log ${MESSAGE }
1717 Log ${NAD }
Original file line number Diff line number Diff line change 1+ import os
12import re
23from collections import namedtuple
34
@@ -66,6 +67,11 @@ def visit_TestCase(self, node):
6667 previous_token = token
6768 elif element_type == Token .TAGS :
6869 tags = [el .value for el in element .tokens if el .type == Token .ARGUMENT ]
70+
71+ for var_name in re .findall (r'%\{(.+?)\}' , doc ):
72+ if var_name in os .environ :
73+ doc = doc .replace (f'%{{{ var_name } }}' , os .environ [var_name ])
74+
6975 if self .evaluate_inclusion (tags ):
7076 self .tests .append (self .TestAttributes (node .name , doc , tags ))
7177
Original file line number Diff line number Diff line change @@ -46,8 +46,11 @@ commands =
4646 flake8 mlx setup.py
4747
4848[testenv:sphinx2.4.5]
49+ setenv =
50+ RUNTIME_VAR = Test env variable
4951deps =
5052 {[testenv]deps}
53+ setuptools<70
5154 jinja2 == 2.11.3
5255 markupsafe == 1.1.0
5356 docutils == 0.17
@@ -67,6 +70,8 @@ commands=
6770 mlx-warnings --config warnings_config.yml --command make -C doc html
6871
6972[testenv:sphinx-latest]
73+ setenv =
74+ RUNTIME_VAR = Test env variable
7075deps =
7176 {[testenv]deps}
7277 sphinx
You can’t perform that action at this time.
0 commit comments