From: Günter M. <mi...@us...> - 2021-07-05 10:26:30
|
Ticket moved from /p/docutils/bugs/420/ Can't be converted: - **_milestone**: --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** open **Group:** **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Mon Jul 05, 2021 10:26 AM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Günter M. <mi...@us...> - 2021-07-05 10:32:50
|
[Docutils testing](https://docutils.sourceforge.io/docs/dev/testing.html) builds on the included batteries, there is no support for the 3rd party "pytest" framework. If there is interest and someone volunteering for the work, we may discuss about adding such support. --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** open **Group:** **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Mon Jul 05, 2021 10:26 AM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Tomasz Kło. <kl...@us...> - 2022-01-05 05:48:22
|
> Docutils testing builds on the included batteries, there is no support for the 3rd party "pytest" framework. docutils uses unittest module and pytest can handle unittrst units .. +/- some issues with units code which in ths case has been exposed. And about topic od the github/gitlab .. it would be good to migrate man VCS to one of those sites because they are offering to downlaod exact commit as patch over REST https interface. sf.net sdoes not offer that. This is extreamly useful on dowloading parches by build automation. In other words without such interface on top of the VCS such interraction is not possible. --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** open **Group:** **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Wed Sep 01, 2021 06:53 PM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Tomasz Kło. <kl...@us...> - 2021-09-01 18:53:41
|
BTW it would be really good to migrate from svn to git and best move repo to github or gitlab because sf.net VCS frontend does not allow download exact commit as patch. --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** open **Group:** **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Mon Jul 05, 2021 10:32 AM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Günter M. <mi...@us...> - 2021-09-06 21:37:07
|
> BTW it would be really good to migrate from svn to git and best move > repo to github or gitlab because sf.net VCS frontend does not allow > download exact commit as patch. You may the Git mirror at http://repo.or.cz/docutils.git or the Github live-clone. Cf. https://docutils.sourceforge.io/docs/dev/repository.html Günter --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** open **Group:** **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Wed Sep 01, 2021 06:53 PM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Tomasz Kło. <kl...@us...> - 2022-01-05 05:50:05
|
BTW latest pytest shows some deprecation warnings ~~~ ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:81: optional module "recommonmark" not found SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:70: optional module "recommonmark" not found ========================================================= 227 passed, 2 skipped, 9 deselected, 8 warnings in 3.28s ========================================================= ~~~ --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** open **Group:** **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Wed Jan 05, 2022 05:48 AM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Günter M. <mi...@us...> - 2022-01-06 00:27:14
|
This should be fixed in [r8933]. Thank you for the report. --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** open **Group:** **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Wed Jan 05, 2022 05:50 AM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Günter M. <mi...@us...> - 2022-01-06 15:15:04
|
See also bug #441 about "optparse" DeprecationWarnings. --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** open **Group:** **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Thu Jan 06, 2022 12:27 AM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: engelbert g. <gr...@us...> - 2022-01-07 10:55:43
|
Hei Thomas, you are testing docutils-0.17.1 does this mean you require the fix on 0.17 ? --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** open **Group:** **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Thu Jan 06, 2022 03:15 PM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Tomasz Kło. <kl...@us...> - 2022-01-07 13:57:01
|
I'm only reporting that pytest is failing. So far all my rpm packages which are using docutils are building with docutils build with disabled on testing all those failing units so I cannot tell that I need something :) Nevertheless probably it would be good to look closet on why those units are failing ad fix test suite or tested code :) --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** open **Group:** **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Fri Jan 07, 2022 10:55 AM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Günter M. <mi...@us...> - 2022-01-07 23:49:57
|
Thank you, Tomasz, for the reports. Could you re-test with a current [repository check-out or snapshot](https://docutils.sourceforge.io/README.html#development-version) and attach an error log if there are still problems? --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** open **Group:** **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Fri Jan 07, 2022 01:56 PM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Günter M. <mi...@us...> - 2022-01-07 23:54:40
|
I could reproduce with #> cd <repository-checkout-root>/docutils/test #> pytest ... ===== 238 passed, 1 skipped, 2 warnings, 7 errors in 2.08s ==== I'll have a look into the issues later. --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** open **Group:** **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Fri Jan 07, 2022 11:49 PM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Günter M. <mi...@us...> - 2022-01-12 16:05:15
|
The problem is, that the Docutils test suite uses classes derived from standard unittest that add arguments to `__init__()` which makes them incompatible to the pytest (and nosetest) frameworks. This is now documented (in [r8945]). Besides the remaining errors, pytest also finds only 237 of the 1599 tests in the test suite. Running the suite as documented in https://docutils.sourceforge.io/docs/dev/testing.html works. --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** open **Group:** **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Fri Jan 07, 2022 11:54 PM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Günter M. <mi...@us...> - 2022-01-12 16:06:16
|
- **status**: open --> closed-works-for-me - **Group**: --> Default - **Comment**: Closing this, as there is no easy fix. Thanks again for the report. --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** closed-works-for-me **Group:** Default **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Wed Jan 12, 2022 04:05 PM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Adam T. <aa-...@us...> - 2022-01-12 16:22:45
|
I've made progress on "standardising" the docutils testing setup in https://github.com/AA-Turner/docutils/tree/testing-runner "standardising" here means moving to the point where standard `python -m unittest` would work on the `test/` directory. Unittest itself has also changed somewhat since the python2 days, and several of the additions docutils makes are no longer needed / superseeded by the stdlib. If there would be interest in adopting this work, I can finish it up and propose it as a set of clean patches. A --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** closed-works-for-me **Group:** Default **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Wed Jan 12, 2022 04:06 PM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Günter M. <mi...@us...> - 2022-01-12 21:36:09
|
On 2022-01-12, Adam Turner wrote: > I've made progress on "standardising" the docutils testing setup in > https://github.com/AA-Turner/docutils/tree/testing-runner > ... > If there would be interest in adopting this work, I can finish it up > and propose it as a set of clean patches. I had a quick look and the work looks promising, so yes, I would like to give it a try. What is the effect on the test time and on the output if there are, e.g., differences between output and expected in functional tests? To avoid wasted work (and the sunken-cost fallacy), I propose to split the project into smaller changesets (of 1 to ca. 7 commits) which we can discuss and adapt before pushing to origin/master and then move to the next step. I expect some rounds of discussion per step, so there is no need to invest heavily in polishing in the first round. A link to a patch that I can apply with `git am -3` to a local branch would be fine. The discussion could move to docutils-develop or a new ticket, whatever you prefer. Thanks, Günter --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** closed-works-for-me **Group:** Default **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Wed Jan 12, 2022 04:24 PM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Adam T. <aa-...@us...> - 2022-01-12 16:24:28
|
(note I'm not proposing moving to `pytest` -- that would have benefits, but I think should be kept as a distinct change. The work I've done would make it easier to transition, though) --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** closed-works-for-me **Group:** Default **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Wed Jan 12, 2022 04:22 PM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Günter M. <mi...@us...> - 2022-01-14 13:33:14
|
- **status**: closed-works-for-me --> open --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** open **Group:** Default **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Wed Jan 12, 2022 04:24 PM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Adam T. <aa-...@us...> - 2022-11-10 17:11:06
|
With [r9237] the test-suite refactoring project is complete -- using `pytest` and `python -m unittest` now work "out-of-the-box". A --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** open **Group:** Default **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Fri Jan 14, 2022 01:33 PM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Adam T. <aa-...@us...> - 2022-11-10 17:11:58
|
- **status**: open --> closed-fixed --- ** [feature-requests:#81] 0.17.1: pytest is failing** **Status:** closed-fixed **Group:** Default **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Thu Nov 10, 2022 05:11 PM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Adam T. <aa-...@us...> - 2022-11-10 17:12:29
|
- **summary**: 0.17.1: pytest is failing --> Support for pytest --- ** [feature-requests:#81] Support for pytest** **Status:** closed-fixed **Group:** Default **Created:** Sun Jun 27, 2021 03:07 AM UTC by Tomasz Kłoczko **Last Updated:** Thu Nov 10, 2022 05:11 PM UTC **Owner:** nobody Just normal build, install and test cycle used on building package from non-root account: - "setup.py build" - "setup.py install --root </install/prefix>" - "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix> ~~~ + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) Using --randomly-seed=2664516846 rootdir: /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1 plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0 collected 240 items test/test_statemachine.py ................. [ 7%] test/test_functional.py E [ 7%] test/test_dependencies.py ..... [ 9%] test/test_parsers/test_get_parser_class.py ... [ 10%] test/test_writers/test_latex2e_misc.py . [ 11%] test/test_publisher.py .... [ 12%] test/test_writers/test_get_writer_class.py ... [ 14%] test/test__init__.py .. [ 15%] . . [ 15%] test/test__init__.py ...... [ 17%] test/test_settings.py ........................ [ 28%] test/test_writers/test_docutils_xml.py ..... [ 30%] test/test_parsers/test_parser.py . [ 30%] test/test_transforms/test___init__.py . [ 30%] test/test_language.py EEEE [ 32%] test/test_traversals.py . [ 33%] test/test_writers/test_odt.py .......... [ 37%] test/test_command_line.py F [ 37%] test/test_writers/test_html5_polyglot_parts.py EE [ 38%] test/test_nodes.py ............................... [ 51%] test/test_writers/test_html5_polyglot_misc.py ............... [ 57%] test/test_pickle.py . [ 58%] tools/test/test_buildhtml.py .. [ 58%] test/test_io.py ................. [ 66%] test/test_readers/test_get_reader_class.py ... [ 67%] test/test_error_reporting.py ............. [ 72%] test/test_writers/test_html4css1_misc.py ............... [ 79%] test/test_parsers/test_rst/test_directives/test_code_parsing.py .. [ 79%] test/test_utils.py ........................ [ 89%] test/test_parsers/test_recommonmark/test_misc.py ..Fs [ 91%] test/test_parsers/test_rst/test_directives/test__init__.py .... [ 93%] test/test_viewlist.py ................ [100%] ================================================================================== ERRORS ================================================================================== ________________________________________________________________ ERROR at setup of FunctionalTestCase.test _________________________________________________________________ self = <[AttributeError("'FunctionalTestCase' object has no attribute '_testMethodName'") raised in repr()] FunctionalTestCase object at 0x7fbd75666df0>, args = ('test',) kwargs = {} def __init__(self, *args, **kwargs): """Set self.configfile, pass arguments to parent __init__.""" > self.configfile = kwargs['configfile'] E KeyError: 'configfile' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_functional.py:95: KeyError ____________________________________________________________ ERROR at setup of LanguageTestCase.test_directives ____________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754ce0d0> args = ('test_directives',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_roles _______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753f98b0>, args = ('test_roles',) kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError _______________________________________________________ ERROR at setup of LanguageTestCase.test_bibliographic_fields _______________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd753c4850> args = ('test_bibliographic_fields',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________________ ERROR at setup of LanguageTestCase.test_labels ______________________________________________________________ self = <[AttributeError("'LanguageTestCase' object has no attribute '_testMethodName'") raised in repr()] LanguageTestCase object at 0x7fbd754181f0> args = ('test_labels',), kwargs = {} def __init__(self, *args, **kwargs): self.ref = docutils.languages.get_language(reference_language, _reporter) > self.language = kwargs['language'] E KeyError: 'language' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_language.py:81: KeyError ______________________________________________________ ERROR at setup of HtmlWriterPublishPartsTestCase.test_publish _______________________________________________________ self = <[AttributeError("'HtmlWriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] HtmlWriterPublishPartsTestCase object at 0x7fbd54e7e550> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ______________________________________________________ ERROR at setup of Html5WriterPublishPartsTestCase.test_publish ______________________________________________________ self = <[AttributeError("'Html5WriterPublishPartsTestCase' object has no attribute '_testMethodName'") raised in repr()] Html5WriterPublishPartsTestCase object at 0x7fbd75348160> args = ('test_publish',), kwargs = {} def __init__(self, *args, **kwargs): if 'writer_name' in kwargs: self.writer_name = kwargs['writer_name'] del kwargs['writer_name'] > CustomTestCase.__init__(self, *args, **kwargs) E TypeError: __init__() missing 3 required positional arguments: 'input', 'expected', and 'id' /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/DocutilsTestSupport.py:673: TypeError ================================================================================= FAILURES ================================================================================= _____________________________________________________________ CommandLineEncodingTests.test_sys_argv_decoding ______________________________________________________________ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, args = ['-ra', '--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def parse_args(self, args=None, values=None): """ parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. """ rargs = self._get_args(args) if values is None: values = self.get_default_values() # Store the halves of the argument list as attributes for the # convenience of callbacks: # rargs # the rest of the command-line (the "r" stands for # "remaining" or "right-hand") # largs # the leftover arguments -- ie. what's left after removing # options and their arguments (the "l" stands for "leftover" # or "left-hand") self.rargs = rargs self.largs = largs = [] self.values = values try: > stop = self._process_args(largs, rargs, values) /usr/lib64/python3.8/optparse.py:1387: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, largs = [], rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_args(self, largs, rargs, values): """_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. """ while rargs: arg = rargs[0] # We handle bare "--" explicitly, and bare "-" is handled by the # standard arg handler since the short arg case ensures that the # len of the opt string is greater than 1. if arg == "--": del rargs[0] return elif arg[0:2] == "--": # process a single long option (possibly with value(s)) self._process_long_opt(rargs, values) elif arg[:1] == "-" and len(arg) > 1: # process a cluster of short options (possibly with # value(s) for the last one only) > self._process_short_opts(rargs, values) /usr/lib64/python3.8/optparse.py:1431: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, rargs = ['--source-url=test.txt', '--title=Dornröschen'] values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> def _process_short_opts(self, rargs, values): arg = rargs.pop(0) stop = False i = 1 for ch in arg[1:]: opt = "-" + ch option = self._short_opt.get(opt) i += 1 # we have consumed a character if not option: raise BadOptionError(opt) if option.takes_value(): # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg. if i < len(arg): rargs.insert(0, arg[i:]) stop = True nargs = option.nargs if len(rargs) < nargs: self.error(ngettext( "%(option)s option requires %(number)d argument", "%(option)s option requires %(number)d arguments", nargs) % {"option": opt, "number": nargs}) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] else: # option doesn't take a value value = None > option.process(opt, value, values, self) /usr/lib64/python3.8/optparse.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): """ Call the validator function on applicable settings and evaluate the 'overrides' option. Extends `optparse.Option.process`. """ > result = optparse.Option.process(self, opt, value, values, parser) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/frontend.py:354: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' values = <Values at 0x7fbd54bba2e0: {'title': None, 'generator': True, 'datestamp': "%Y-%m-%d %H:%M UTC (If you see this in tes..._visitor': None, '_disable_config': None, '_source': None, '_destination': None, '_config_files': ['./docutils.conf']}> parser = <docutils.frontend.OptionParser object at 0x7fbd54bba550> def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. > value = self.convert_value(opt, value) /usr/lib64/python3.8/optparse.py:779: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def convert_value(self, opt, value): if value is not None: if self.nargs == 1: > return self.check_value(opt, value) /usr/lib64/python3.8/optparse.py:771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_value(self, opt, value): checker = self.TYPE_CHECKER.get(self.type) if checker is None: return value else: > return checker(self, opt, value) /usr/lib64/python3.8/optparse.py:766: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ option = <Option at 0x7fbd54edfd90: -r/--report>, opt = '-r', value = 'a' def check_choice(option, opt, value): if value in option.choices: return value else: choices = ", ".join(map(repr, option.choices)) > raise OptionValueError( _("option %s: invalid choice: %r (choose from %s)") % (opt, value, choices)) E optparse.OptionValueError: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') /usr/lib64/python3.8/optparse.py:440: OptionValueError During handling of the above exception, another exception occurred: self = <test_command_line.CommandLineEncodingTests testMethod=test_sys_argv_decoding> def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument if sys.version_info < (3, 0): sys.argv.append(u'--title=Dornröschen'.encode(argv_encoding)) else: sys.argv.append(u'--title=Dornröschen') publisher = docutils.core.Publisher() > publisher.process_command_line() /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_command_line.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:162: in process_command_line self.settings = option_parser.parse_args(argv) /usr/lib64/python3.8/optparse.py:1389: in parse_args self.error(str(err)) /usr/lib64/python3.8/optparse.py:1569: in error self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <docutils.frontend.OptionParser object at 0x7fbd54bba550>, status = 2 msg = "pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5')\n" def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) > sys.exit(status) E SystemExit: 2 /usr/lib64/python3.8/optparse.py:1559: SystemExit --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- Usage ===== pytest [options] pytest: error: option -r: invalid choice: 'a' (choose from 'info', '1', 'warning', '2', 'error', '3', 'severe', '4', 'none', '5') ________________________________________________________________ reCommonMarkParserTests.test_parsing_error ________________________________________________________________ self = <test_parsers.test_recommonmark.test_misc.reCommonMarkParserTests testMethod=test_parsing_error> @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg) def test_parsing_error(self): > output = publish_string(sample1, parser_name='recommonmark', settings_overrides={'warning_stream': ''}) /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_misc.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:407: in publish_string output, pub = publish_programmatically( /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:665: in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/core.py:217: in publish self.document = self.reader.read(self.source, self.parser, /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:72: in read self.parse() /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/readers/__init__.py:78: in parse self.parser.parse(self.input, document) /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/parsers/recommonmark_wrapper.py:117: in parse if node['level'] != section_level: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <section "title": <title...><paragraph...>>, key = 'level' def __getitem__(self, key): if isinstance(key, basestring): > return self.attributes[key] E KeyError: 'level' /home/tkloczko/rpmbuild/BUILDROOT/python-docutils-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/docutils/nodes.py:652: KeyError ============================================================================= warnings summary ============================================================================= test/test_parsers/test_recommonmark/test_section_headers.py:37 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:37: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:50 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:50: DeprecationWarning: invalid escape sequence \ """\ test/test_parsers/test_recommonmark/test_section_headers.py:164 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_parsers/test_recommonmark/test_section_headers.py:164: DeprecationWarning: invalid escape sequence \ """\ test/test_transforms/test___init__.py:20 /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/test_transforms/test___init__.py:20: PytestCollectionWarning: cannot collect test class 'TestTransform' because it has a __init__ constructor (from: test/test_transforms/test___init__.py) class TestTransform(transforms.Transform): test/test_settings.py::ConfigFileTests::test_old test/test_settings.py::ConfigFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old_and_new test/test_settings.py::ConfigEnvVarFileTests::test_old /home/tkloczko/rpmbuild/BUILD/docutils-0.17.1/test/data/config_old.txt:0: ConfigDeprecationWarning: The "[option]" section is deprecated. Support for old-format configuration files may be removed in a future Docutils release. Please revise your configuration files. See <http://docutils.sf.net/docs/user/config.html>, section "Old-Format Configuration Files". test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled_inline test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_raw_disabled test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error /usr/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] test/test_parsers/test_recommonmark/test_misc.py:91: recommonmark_wrapper: parser found, fallback not used ERROR test/test_functional.py::FunctionalTestCase::test - KeyError: 'configfile' ERROR test/test_language.py::LanguageTestCase::test_directives - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_roles - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_bibliographic_fields - KeyError: 'language' ERROR test/test_language.py::LanguageTestCase::test_labels - KeyError: 'language' ERROR test/test_writers/test_html5_polyglot_parts.py::HtmlWriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inpu... ERROR test/test_writers/test_html5_polyglot_parts.py::Html5WriterPublishPartsTestCase::test_publish - TypeError: __init__() missing 3 required positional arguments: 'inp... FAILED test/test_command_line.py::CommandLineEncodingTests::test_sys_argv_decoding - SystemExit: 2 FAILED test/test_parsers/test_recommonmark/test_misc.py::reCommonMarkParserTests::test_parsing_error - KeyError: 'level' ===================================================== 2 failed, 229 passed, 1 skipped, 11 warnings, 7 errors in 10.64s ===================================================== ~~~ --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Guenter M. <mi...@us...> - 2022-11-19 15:59:30
|
Dear Adam, On 2022-11-10, Adam Turner via Docutils-develop wrote: > With [r9237] the test-suite refactoring project is complete -- using > `pytest` and `python -m unittest` now work "out-of-the-box". Thank you for picking up the large project of modernising and "disentangling" the Docutils test suite. I did not manage to review all the patches line by line but skimmed them and gave the tests a testing: Run all test tests from the ``test`` directory:: #> cd REPO-ROOT/docutils/test Now testing with different methods:: # ./alltests.py [...] Ran 1739 tests in 5.053s OK (skipped=2) Elapsed time: 5.210 seconds * All tests run. * Test reporting (in case of failures) seems OK. * Some diffs only show up after adding ``maxDiff = None`` to the test class definition. :: #> pytest-3 --quiet . [...] =============================== warnings summary =============================== test/test_settings.py::HelperFunctionsTests::test_make_paths_absolute [...] test/test_settings.py::HelperFunctionsTests::test_validate_url_trailing_slash /usr/local/src/docutils-git-svn/docutils/test/test_settings.py:246: DeprecationWarning: The frontend.OptionParser class will be replaced by a subclass of argparse.ArgumentParser in Docutils 0.21 or later. self.option_parser = frontend.OptionParser( test/test_settings.py: 612 warnings /usr/lib/python3.9/optparse.py:1000: DeprecationWarning: The frontend.Option class will be removed in Docutils 0.21 or later. option = self.option_class(*args, **kwargs) -- Docs: https://docs.pytest.org/en/stable/warnings.html 369 passed, 2 skipped, 621 warnings in 6.50s * Only 369 out of 1739 tests reported by "alltests.py" are reported. Is this different counting or does pytest miss more than half of the tests? * The warnings show up despite explicit silencing in the code. (Except when we explicitely test for them.) It seems `pytest` bypasses this and reports anyway?? * ``docs/dev/testing.txt`` suggests ``pytest --quiet ./test`` which fails if the cwd is ``docutils/test`` as suggested by the preceding:: From a shell do [#]_:: cd docutils/test python -u alltests.py I suggest:: - For the pytest_ test framework, from a shell run:: + For the pytest_ test framework:: - pytest --quiet ./test + pytest --quiet . Next the standard Python way:: #> python3.9 -m unittest . Traceback (most recent call last): File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/usr/lib/python3.9/unittest/__main__.py", line 18, in <module> main(module=None) File "/usr/lib/python3.9/unittest/main.py", line 100, in __init__ self.parseArgs(argv) File "/usr/lib/python3.9/unittest/main.py", line 147, in parseArgs self.createTests() File "/usr/lib/python3.9/unittest/main.py", line 158, in createTests self.test = self.testLoader.loadTestsFromNames(self.testNames, File "/usr/lib/python3.9/unittest/loader.py", line 220, in loadTestsFromNames suites = [self.loadTestsFromName(name, module) for name in names] File "/usr/lib/python3.9/unittest/loader.py", line 220, in <listcomp> suites = [self.loadTestsFromName(name, module) for name in names] File "/usr/lib/python3.9/unittest/loader.py", line 154, in loadTestsFromName module = __import__(module_name) ValueError: Empty module name :( The "nose" test framework fails, too:: #> nosetests3 ====================================================================== FAIL: test_parser (test.test_parsers.test_rst.test_directives.test_admonitions_de.ParserTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/src/docutils-git-svn/docutils/test/test_parsers/test_rst/test_directives/test_admonitions_de.py", line 37, in test_parser self.assertEqual(output, case_expected) AssertionError: '<doc[27 chars] <system_message level="1" line="1" source=[358 chars]n.\n' != '<doc[27 chars] <admonition classes="admonition-admonition[105 chars]n.\n' <document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - No directive entry for "admonition" in module "docutils.parsers.rst.languages.de". - Using English fallback for directive "admonition". <admonition classes="admonition-admonition"> <title> Admonition <paragraph> This is a generic admonition. ====================================================================== FAIL: test_parser (test.test_parsers.test_rst.test_directives.test_admonitions_dummy_lang.ParserTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/src/docutils-git-svn/docutils/test/test_parsers/test_rst/test_directives/test_admonitions_dummy_lang.py", line 32, in test_parser self.assertEqual(output, case_expected) AssertionError: '<doc[115 chars] <system_message level="1" line="3" source=[274 chars]).\n' != '<doc[115 chars] <attention>\n <paragraph>\n [40 chars]).\n' <document source="test data"> <attention> <paragraph> directive with silly localised name. - <system_message level="1" line="3" source="test data" type="INFO"> - <paragraph> - No directive entry for "Attention" in module "local_dummy_lang". - Using English fallback for directive "Attention". <attention> <paragraph> English fallback (an INFO is written). ---------------------------------------------------------------------- Ran 79 tests in 0.642s FAILED (SKIP=1, failures=2) Running idividual test files:: #> python3 test_error_reporting.py Traceback (most recent call last): File "/usr/local/src/docutils-git-svn/docutils/test/test_error_reporting.py", line 32, in <module> from test import DocutilsTestSupport # NoQA: F401 ImportError: cannot import name 'DocutilsTestSupport' from 'test' (/usr/lib/python3.9/test/__init__.py) Its a "chicken or egg" problem: the only remaining code in ``DocutilsTestSupport.py`` is adding the "docutils root" and the "test root" to sys.path. However, it can only be imported if "test" is recognized as package. The solution is inlining the path-modification if scripts are directly started, e.g. ~~~ diff --git a/docutils/test/test_writers/test_html4css1_template.py b/docutils/test/test_writers/test_html4css1_template.py index 4113dd443..f771506a4 100755 --- a/docutils/test/test_writers/test_html4css1_template.py +++ b/docutils/test/test_writers/test_html4css1_template.py @@ -8,11 +8,16 @@ Tests for the HTML writer. """ +from pathlib import Path import os import platform +import sys import unittest -from test import DocutilsTestSupport # NoQA: F401 +if __name__ == '__main__': + # prepend the "docutils root" to the Python library path + # so we import the local `docutils` and `test` packages, + sys.path.insert(0, str(Path(__file__).parents[2])) import docutils from docutils.core import publish_string ~~~ For scripts in the "test root", replace ``parents[2]`` with ``parents[1]`` For deeper nested scripts like docutils/test/test_parsers/test_rst/test_block_quotes.py replace ``parents[2]`` with ``parents[3]`` Also, if importing "unittest" at the top of the file, there is no need to repeat this at the end ~~~ diff --git a/docutils/test/test_parsers/test_rst/test_block_quotes.py b/docutils/test/test_parsers/test_rst/test_block_quotes.py index 4c21e8112..521caf874 100755 --- a/docutils/test/test_parsers/test_rst/test_block_quotes.py +++ b/docutils/test/test_parsers/test_rst/test_block_quotes.py @@ -8,9 +8,14 @@ Tests for states.py. """ +from pathlib import Path +import sys import unittest -from test import DocutilsTestSupport # NoQA: F401 +if __name__ == '__main__': + # prepend the "docutils root" to the Python library path + # so we import the local `docutils` and `test` packages, + sys.path.insert(0, str(Path(__file__).parents[3])) from docutils.frontend import get_default_settings from docutils.parsers.rst import Parser @@ -396,5 +401,4 @@ Paragraph. if __name__ == '__main__': - import unittest unittest.main() ~~~ When inlining the sys.path modification also in "alltests.py", DocutilsTestSupport.py should become redundant. I did not catch whether the adding of the "test root" is actually required anywhere, though. Have a nice weekend, Günter |
From: Guenter M. <mi...@us...> - 2022-11-28 14:01:00
|
Dear Adam, dear Docutils developers, an update on the test suite refactoring: On 2022-11-19, Guenter Milde via Docutils-develop wrote: > On 2022-11-10, Adam Turner via Docutils-develop wrote: > >> With [r9237] the test-suite refactoring project is complete -- using >> `pytest` and `python -m unittest` now work "out-of-the-box". > > Thank you for picking up the large project of modernising and > "disentangling" the Docutils test suite. ... > # ./alltests.py > [...] > Ran 1739 tests in 5.053s ... > #> pytest-3 --quiet . ... > 369 passed, 2 skipped, 621 warnings in 6.50s > > * Only 369 out of 1739 tests reported by "alltests.py" are reported. > Is this different counting or does pytest miss more than half of the tests? > * The warnings do not show up when testing with `alltest.py` > It seems `pytest` bypasses this and reports anyway?? Fortunately, the report does not stand in the way, so we can leave this as-is. > #> python3.9 -m unittest . ... > ValueError: Empty module name I could fix the import errors, now I get:: Ran 377 tests in 5.045s 377 << 1739, missing coverage or different counting? > > The "nose" test framework fails, too:: Fixed but also not all test are found:: > nosetests3 .........................S.......................................... ---------------------------------------------------------------------- Ran 68 tests in 0.320s OK (SKIP=1) > Running idividual test files should work now as well (I did not test all of them, though). Günter |
From: Adam T. <aat...@ou...> - 2022-12-02 13:57:36
|
Dear Günter, This note contains replies to all the recent emails in the "0.17.1: pytest is failing" thread. > On 2022-11-10, Adam Turner via Docutils-develop wrote: >> With [r9237] the test-suite refactoring project is complete -- using >> `pytest` and `python -m unittest` now work "out-of-the-box". ----- > Run all test tests from the ``test`` directory:: > > #> cd REPO-ROOT/docutils/test > > Now testing with different methods:: > > # ./alltests.py > [...] > > * All tests run. > * Test reporting (in case of failures) seems OK. > * Some diffs only show up after adding ``maxDiff = None`` to the test class > definition. Perhaps we should add ``maxDiff = None`` to all test cases. ----- > :: > > #> pytest-3 --quiet . > [...] > > > * Only 369 out of 1739 tests reported by "alltests.py" are reported. > Is this different counting or does pytest miss more than half of the tests? Different counting -- "sub tests" aren't counted individually by default, see ``NumbersTestResult`` in ``alltests.py``. > * The warnings show up despite explicit silencing in the code. > (Except when we explicitely test for them.) > It seems `pytest` bypasses this and reports anyway?? ``test_settings`` didn't have the warnings silenced in the ``setUp()`` block. ----- > Next the standard Python way:: > > #> python3.9 -m unittest . > > :( ``python -m unittest`` has an odd calling convention. Had you typed ``python -m unittest``, it would've succeeded, as it is shorthand for the 'actual' call of ``python -m unittest discover .``. Adding any arguments means the shorthand isn't used, though. I am unsure if we should declare support for this method of running tests, whilst it works it may constrain us should we choose e.g. to move to ``pytest`` more properly. ----- > The "nose" test framework fails, too:: ``nose`` is unsupported and I don't intend to support it. The maintainers don't recommend using it (https://nose.readthedocs.io/en/latest/#note-to-users) ----- > Running idividual test files:: > [...] > Its a "chicken or egg" problem: the only remaining code in ``DocutilsTestSupport.py`` is adding the "docutils root" and the "test root" > to sys.path. However, it can only be imported if "test" is recognized as package. Must the executable be ``python`` here? ``pytest .\test_parsers\test_rst\test_definition_lists.py`` works, as ``pytest`` discovers the root directory as the one containing ``setup.cfg`` (or a numer of other sentinel files) and prepends it to ``sys.path``. Similarly, ``pytest test_definition_lists.py`` works within ``test\test_parsers\test_rst``. ----- > trying the test suite on an installation without recommonmark, I stumbled about a new problem: > > Traceback (most recent call last): > [...] > raise unittest.SkipTest(f'Cannot test "{md_parser}". ' > unittest.case.SkipTest: Cannot test "recommonmark". Parser not found. > > It seems raising SkipTest is only applicable for test run through the unittest framework (where I am not sure all test run). Ahh, we should use ``unittest.defaultTestLoader.discover`` to load tests, this respects ``SkipTest``. Thanks, Adam |
From: Guenter M. <mi...@us...> - 2022-12-05 15:38:23
|
Dear Adam, dear Docutils developers, On 2022-12-02, Adam Turner wrote: ... > Perhaps we should add ``maxDiff = None`` to all test cases. To all tests where it applies, yes. But this might also be done step by step whenever required. >> #> pytest-3 --quiet . >> [...] >> * Only 369 out of 1739 tests reported by "alltests.py" are reported. >> Is this different counting or does pytest miss more than half of the >> tests? > Different counting -- "sub tests" aren't counted individually by > default, see ``NumbersTestResult`` in ``alltests.py``. Ah. So this is because a large number of tests becam "downgraded" to sub-tests. ... > I am unsure if we should declare support for this method of running > tests, whilst it works it may constrain us should we choose e.g. to > move to ``pytest`` more properly. We would need to announce this new requirement anyway. For now, we may just add a caveat, e.g. diff --git a/docutils/docs/dev/testing.txt b/docutils/docs/dev/testing.txt index be934a7af..817f20733 100644 --- a/docutils/docs/dev/testing.txt +++ b/docutils/docs/dev/testing.txt @@ -40,15 +40,15 @@ In a pinch, the edge cases should cover most of it. .. note:: The ``alltests.py`` test runner is based on the standard library's unittest_ framework. - Since Docutils 0.19, running ``python -m unittest``, the pytest_, and the - nose_ frameworks no longer result in spurious failures (cf. `bug #270`_). - However, there are differences in the reported number of tests and in - test coverage. + Since Docutils 0.19, running ``python -m unittest`` and the pytest_ + framework no longer result in spurious failures (cf. `bug #270`_). + However, there are differences in the reported number of tests + (``alltests.py`` also counts sub-tests). + In future, running the test suite may require pytest_. __ policies.html#check-ins .. _unittest: https://docs.python.org/3/library/unittest.html .. _pytest: https://pypi.org/project/pytest -.. _nose: https://pypi.org/project/nose .. _`bug #270`: https://sourceforge.net/p/docutils/bugs/270/ >> The "nose" test framework fails, too:: > ``nose`` is unsupported and I don't intend to support it. The > maintainers don't recommend using it > (https://nose.readthedocs.io/en/latest/#note-to-users) OK. > ----- >> Running idividual test files:: > Must the executable be ``python`` here? > ``pytest .\test_parsers\test_rst\test_definition_lists.py`` works, as > ``pytest`` discovers the root directory as the one containing > ``setup.cfg`` (or a numer of other sentinel files) and prepends it to > ``sys.path``. Similarly, ``pytest test_definition_lists.py`` works > within ``test\test_parsers\test_rst``. With the fixes in r9263+, individual test files run fine again. Switching to pytest is an option for the future (would require changing the "shebang line"). > ----- >> trying the test suite on an installation without recommonmark, I >> stumbled about a new problem: >> Traceback (most recent call last): >> [...] >> raise unittest.SkipTest(f'Cannot test "{md_parser}". ' >> unittest.case.SkipTest: Cannot test "recommonmark". Parser not found. >> It seems raising SkipTest is only applicable for test run through the unittest framework (where I am not sure all test run). > Ahh, we should use ``unittest.defaultTestLoader.discover`` to load > tests, this respects ``SkipTest``. Solved now. Thank you for the work and for the explanations. Günter |