and is used to provide the test cases so that nose-parameterized can auto-generate one test method per test case.If running Sphinx to create API documentation then the test harness initialisation is not done and, instead, a generator that contains zero test cases is returned. This is a hack to workaround Sphinx's execution of the Python it parses. Sphinx is detected if sys.argv[0] (the current command) contains the text sphinx-build.
If this is not done, then Sphinx documentation generation fails for this class and sub-classes as it tries to initialise the test harness.
Perhaps a less hacky solution can be adopted. I tried setting the environment variable, PROV_HARNESS_CONFIGURATION to point to a simple harness.yml file which points to a directory with no test cases, but getting the environment variable through Make and Sphinx proved problematic and would have needed the introduction of another shell script, which seemed like overengineering.
The ConverterTestCase class has a method:
which initialises the test harness and provide the test cases as a generator. This is called back from:
and is used to provide the test cases so that nose-parameterized can auto-generate one test method per test case.If running Sphinx to create API documentation then the test harness initialisation is not done and, instead, a generator that contains zero test cases is returned. This is a hack to workaround Sphinx's execution of the Python it parses. Sphinx is detected if
sys.argv[0]
(the current command) contains the textsphinx-build
.If this is not done, then Sphinx documentation generation fails for this class and sub-classes as it tries to initialise the test harness.
Perhaps a less hacky solution can be adopted. I tried setting the environment variable,
PROV_HARNESS_CONFIGURATION
to point to a simpleharness.yml
file which points to a directory with no test cases, but getting the environment variable through Make and Sphinx proved problematic and would have needed the introduction of another shell script, which seemed like overengineering.