zopefoundation/ZConfig

3.6.1: pytest is failing in `src/ZConfig/tests/test_validator.py::TestValidator::test_schema_only` unit

Closed this issue · 2 comments

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-ZConfig-3.6.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-ZConfig-3.6.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.16, pytest-7.2.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.1
collected 360 items

src/ZConfig/components/basic/tests/test_mapping.py ....                                                                                                              [  1%]
src/ZConfig/components/logger/tests/test_formatter.py ..................................................ssss....................                                     [ 21%]
src/ZConfig/components/logger/tests/test_logger.py ...............................................                                                                   [ 34%]
src/ZConfig/tests/test_cfgimports.py ......                                                                                                                          [ 36%]
src/ZConfig/tests/test_cmdline.py ..........                                                                                                                         [ 39%]
src/ZConfig/tests/test_config.py ................                                                                                                                    [ 43%]
src/ZConfig/tests/test_cookbook.py ..                                                                                                                                [ 44%]
src/ZConfig/tests/test_datatypes.py ........................                                                                                                         [ 50%]
src/ZConfig/tests/test_info.py ...............                                                                                                                       [ 55%]
src/ZConfig/tests/test_loader.py .........................                                                                                                           [ 61%]
src/ZConfig/tests/test_matcher.py .......                                                                                                                            [ 63%]
src/ZConfig/tests/test_pygments.py .............                                                                                                                     [ 67%]
src/ZConfig/tests/test_readme.py .                                                                                                                                   [ 67%]
src/ZConfig/tests/test_schema.py ........................................................................................                                            [ 92%]
src/ZConfig/tests/test_schema2html.py .............                                                                                                                  [ 95%]
src/ZConfig/tests/test_schemaless.py ..                                                                                                                              [ 96%]
src/ZConfig/tests/test_subst.py .......                                                                                                                              [ 98%]
src/ZConfig/tests/test_validator.py ...F..                                                                                                                           [100%]

================================================================================= FAILURES =================================================================================
______________________________________________________________________ TestValidator.test_schema_only ______________________________________________________________________

self = <ZConfig.tests.test_validator.TestValidator testMethod=test_schema_only>

    def test_schema_only(self):
>       res = run_validator("--schema", support.input_file('simple.xml'))

src/ZConfig/tests/test_validator.py:42:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/ZConfig/tests/test_validator.py:24: in run_validator
    return validator.main(args)
src/ZConfig/validator.py:66: in main
    ZConfig.loadConfigFile(schema, f)
src/ZConfig/loader.py:113: in loadConfigFile
    return _get_config_loader(schema, overrides).loadFile(file, url)
src/ZConfig/loader.py:171: in loadFile
    return self.loadResource(r)
src/ZConfig/loader.py:409: in loadResource
    self._parse_resource(sm, resource)
src/ZConfig/loader.py:454: in _parse_resource
    parser.parse(matcher)
src/ZConfig/cfgparser.py:60: in parse
    done, line = self.nextline()
src/ZConfig/cfgparser.py:53: in nextline
    line = self.file.readline()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_pytest.capture.DontReadFromInput object at 0x7f67fe54fdf0>, args = ()

    def read(self, *args):
>       raise OSError(
            "pytest: reading from stdin while output is captured!  Consider using `-s`."
        )
E       OSError: pytest: reading from stdin while output is captured!  Consider using `-s`.

/usr/lib/python3.8/site-packages/_pytest/capture.py:192: OSError
============================================================================= warnings summary =============================================================================
src/ZConfig/components/basic/tests/test_mapping.py::test_suite
  /usr/lib/python3.8/site-packages/_pytest/python.py:204: PytestReturnNotNoneWarning: Expected None, but src/ZConfig/components/basic/tests/test_mapping.py::test_suite returned <unittest.suite.TestSuite tests=[<unittest.suite.TestSuite tests=[<ZConfig.components.basic.tests.test_mapping.BasicSectionTypeTestCase testMethod=test_derived_dict>, <ZConfig.components.basic.tests.test_mapping.BasicSectionTypeTestCase testMethod=test_simple_dict>, <ZConfig.components.basic.tests.test_mapping.BasicSectionTypeTestCase testMethod=test_simple_empty_dict>]>]>, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
    warnings.warn(

src/ZConfig/components/logger/tests/test_logger.py::test_suite
  /usr/lib/python3.8/site-packages/_pytest/python.py:204: PytestReturnNotNoneWarning: Expected None, but src/ZConfig/components/logger/tests/test_logger.py::test_suite returned <unittest.suite.TestSuite tests=[<unittest.suite.TestSuite tests=[<unittest.suite.TestSuite tests=[<ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_config_without_handlers>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_config_without_logger>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_custom_formatter>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_delayed_stderr>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_delayed_stdout>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_encoded_stderr>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_encoded_stdout>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_factory_without_stream>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_with_email_notifier>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_with_email_notifier_with_credentials>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_with_email_notifier_with_invalid_credentials>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_with_encoded>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_with_http_logger_localhost>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_with_http_logger_remote_host>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_with_logfile>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_with_logfile_delayed>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_with_rotating_logfile>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_with_rotating_logfile_and_STD_should_fail>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_with_stderr>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_with_stdout>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_with_syslog>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_with_timed_rotating_logfile>, <ZConfig.components.logger.tests.test_logger.TestConfig testMethod=test_with_timed_rotating_logfile_and_size_should_fail>]>, <unittest.suite.TestSuite tests=[<ZConfig.components.logger.tests.test_logger.TestFunctions testMethod=test_close_files>, <ZConfig.components.logger.tests.test_logger.TestFunctions testMethod=test_http_handler_url>, <ZConfig.components.logger.tests.test_logger.TestFunctions testMethod=test_http_method>, <ZConfig.components.logger.tests.test_logger.TestFunctions testMethod=test_log_format_bad_syntax_1>, <ZConfig.components.logger.tests.test_logger.TestFunctions testMethod=test_log_format_bad_syntax_2>, <ZConfig.components.logger.tests.test_logger.TestFunctions testMethod=test_log_format_func_name>, <ZConfig.components.logger.tests.test_logger.TestFunctions testMethod=test_log_format_levelno_integer>, <ZConfig.components.logger.tests.test_logger.TestFunctions testMethod=test_log_format_msecs_float>, <ZConfig.components.logger.tests.test_logger.TestFunctions testMethod=test_log_format_ok>, <ZConfig.components.logger.tests.test_logger.TestFunctions testMethod=test_log_format_relative_created_float>, <ZConfig.components.logger.tests.test_logger.TestFunctions testMethod=test_log_format_unknown_key>, <ZConfig.components.logger.tests.test_logger.TestFunctions testMethod=test_logging_level>, <ZConfig.components.logger.tests.test_logger.TestFunctions testMethod=test_reopen_files_missing_wref>, <ZConfig.components.logger.tests.test_logger.TestFunctions testMethod=test_resolve_deep>, <ZConfig.components.logger.tests.test_logger.TestFunctions testMethod=test_syslog_facility>]>, <unittest.suite.TestSuite tests=[<ZConfig.components.logger.tests.test_logger.TestReopeningLogfiles testMethod=test_filehandler_reopen>, <ZConfig.components.logger.tests.test_logger.TestReopeningLogfiles testMethod=test_filehandler_reopen_thread_safety>, <ZConfig.components.logger.tests.test_logger.TestReopeningLogfiles testMethod=test_logfile_reopening>, <ZConfig.components.logger.tests.test_logger.TestReopeningLogfiles testMethod=test_with_logfile_delayed_reopened>]>, <unittest.suite.TestSuite tests=[<ZConfig.components.logger.tests.test_logger.TestReopeningRotatingLogfiles testMethod=test_filehandler_reopen>, <ZConfig.components.logger.tests.test_logger.TestReopeningRotatingLogfiles testMethod=test_logfile_reopening>]>, <unittest.suite.TestSuite tests=[<ZConfig.components.logger.tests.test_logger.TestStartupHandler testMethod=test_buffer>]>, <unittest.suite.TestSuite tests=[]>]>, <doctest._DocTestSuite tests=[test_logger_convenience_function_and_ommiting_name_to_get_root_logger (ZConfig.components.logger.tests.test_logger)]>]>, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
    warnings.warn(

src/ZConfig/tests/test_cfgimports.py::test_suite
  /usr/lib/python3.8/site-packages/_pytest/python.py:204: PytestReturnNotNoneWarning: Expected None, but src/ZConfig/tests/test_cfgimports.py::test_suite returned <unittest.suite.TestSuite tests=[<unittest.suite.TestSuite tests=[<ZConfig.tests.test_cfgimports.TestImportFromConfiguration testMethod=test_bogus_directive>, <ZConfig.tests.test_cfgimports.TestImportFromConfiguration testMethod=test_empty_directive>, <ZConfig.tests.test_cfgimports.TestImportFromConfiguration testMethod=test_missing_import>, <ZConfig.tests.test_cfgimports.TestImportFromConfiguration testMethod=test_repeated_import>, <ZConfig.tests.test_cfgimports.TestImportFromConfiguration testMethod=test_simple_import>]>]>, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
    warnings.warn(

src/ZConfig/tests/test_config.py::test_suite
  /usr/lib/python3.8/site-packages/_pytest/python.py:204: PytestReturnNotNoneWarning: Expected None, but src/ZConfig/tests/test_config.py::test_suite returned <unittest.suite.TestSuite tests=[<unittest.suite.TestSuite tests=[<ZConfig.tests.test_config.ConfigurationTestCase testMethod=test_bad_directive>, <ZConfig.tests.test_config.ConfigurationTestCase testMethod=test_bad_key>, <ZConfig.tests.test_config.ConfigurationTestCase testMethod=test_bad_section>, <ZConfig.tests.test_config.ConfigurationTestCase testMethod=test_configuration_error_str>, <ZConfig.tests.test_config.ConfigurationTestCase testMethod=test_define>, <ZConfig.tests.test_config.ConfigurationTestCase testMethod=test_define_errors>, <ZConfig.tests.test_config.ConfigurationTestCase testMethod=test_fragment_ident_disallowed>, <ZConfig.tests.test_config.ConfigurationTestCase testMethod=test_include>, <ZConfig.tests.test_config.ConfigurationTestCase testMethod=test_includes_with_defines>, <ZConfig.tests.test_config.ConfigurationTestCase testMethod=test_load_from_abspath>, <ZConfig.tests.test_config.ConfigurationTestCase testMethod=test_load_from_fileobj>, <ZConfig.tests.test_config.ConfigurationTestCase testMethod=test_load_from_relpath>, <ZConfig.tests.test_config.ConfigurationTestCase testMethod=test_simple_gets>, <ZConfig.tests.test_config.ConfigurationTestCase testMethod=test_simple_sections>, <ZConfig.tests.test_config.ConfigurationTestCase testMethod=test_type_errors>]>]>, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
    warnings.warn(

src/ZConfig/tests/test_cookbook.py::test_suite
  /usr/lib/python3.8/site-packages/_pytest/python.py:204: PytestReturnNotNoneWarning: Expected None, but src/ZConfig/tests/test_cookbook.py::test_suite returned <unittest.suite.TestSuite tests=[<unittest.suite.TestSuite tests=[<ZConfig.tests.test_cookbook.CookbookTestCase testMethod=test_rewriting_key_names>]>]>, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
    warnings.warn(

src/ZConfig/tests/test_readme.py::test_suite
  /usr/lib/python3.8/site-packages/_pytest/python.py:204: PytestReturnNotNoneWarning: Expected None, but src/ZConfig/tests/test_readme.py::test_suite returned <unittest.suite.TestSuite tests=[<unittest.suite.TestSuite tests=[/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.1/README.rst]>, <unittest.suite.TestSuite tests=[/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.1/docs/using-logging.rst]>]>, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
    warnings.warn(

src/ZConfig/tests/test_schema.py::test_suite
  /usr/lib/python3.8/site-packages/_pytest/python.py:204: PytestReturnNotNoneWarning: Expected None, but src/ZConfig/tests/test_schema.py::test_suite returned <unittest.suite.TestSuite tests=[<unittest.suite.TestSuite tests=[<ZConfig.tests.test_schema.SchemaTestCase testMethod=test_abstracttype_extension>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_abstracttype_extension_errors>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_app_datatype>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_app_sectiontype>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_arbitrary_key>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_arbitrary_key_bad_schema>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_arbitrary_key_missing>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_arbitrary_key_with_defaults>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_arbitrary_key_with_unkeyed_default>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_arbitrary_keys_with_others>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_arbitrary_multikey_optional>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_arbitrary_multikey_optional_empty>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_arbitrary_multikey_required>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_arbitrary_multikey_with_defaults>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_arbitrary_multikey_with_unkeyed_default>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_bad_handler_maps>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_datatype_casesensitivity>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_datatype_conversion_error>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_deeply_nested_sections>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_default_keys_rechecked_clash_in_derived_sectiontype>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_default_keys_rechecked_dont_clash_in_derived_sectiontype>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_disallowed_duplicate_attribute>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_duplicate_default_key_checked_in_schema>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_duplicate_section_names>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_empty_sections>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_error_abstracttype>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_error_bad_parent>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_error_component_section>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_error_extra_cdata>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_error_import_fragment>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_error_key_info>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_error_multikey>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_error_multisection>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_error_required_value>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_error_section>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_error_sectiontype>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_error_subclass>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_error_unknown_doc>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_extends_description_first_extended_wins>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_extends_description_override>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_extends_fragment_failure>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_getrequiredtypes>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_getunusedtypes>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_handler_ordering>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_key_default_element>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_key_example>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_key_required_but_missing>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_keytype_applies_to_default_key>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_keytype_identifier>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_load_abstracttype>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_metadefault>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_minimal_schema>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_multi_extends_datatype_conflict>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_multi_extends_explicit_datatype_OK>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_multi_extends_explicit_keytype_OK>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_multi_extends_implicit_OK>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_multi_extends_keytype_conflict>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_multikey_example>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_multikey_required>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_multiple_descriptions_is_error>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_multiple_examples_is_error>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_multisection_example>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_multisection_required>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_multivalued_keys>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_nested_abstract_sectiontype>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_nested_abstract_sectiontype_without_name>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_numeric_section_name>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_reserved_attribute_prefix>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_schema_example>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_schema_keytype>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_section_example>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_section_required_but_missing>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_section_value_mutation>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_sectiontype_as_schema>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_sectiontype_derived_keytype>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_sectiontype_example>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_sectiontype_extension>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_sectiontype_extension_errors>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_sectiontype_inherited_datatype>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_sectiontype_override_keytype>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_simple>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_simple_anonymous_section>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_simple_anonymous_section_without_name>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_simple_anynamed_section>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_simple_extends>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_srepr>, <ZConfig.tests.test_schema.SchemaTestCase testMethod=test_unknown_datatype_name>]>]>, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
    warnings.warn(

src/ZConfig/tests/test_schema2html.py: 15 warnings
  /home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.1/src/ZConfig/sphinx.py:46: DeprecationWarning: The frontend.OptionParser class will be replaced by a subclass of argparse.ArgumentParser in Docutils 0.21 or later.
    self.settings = docutils.frontend.OptionParser(

src/ZConfig/tests/test_schema2html.py: 1360 warnings
  /usr/lib64/python3.8/optparse.py:1000: DeprecationWarning: The frontend.Option class will be removed in Docutils 0.21 or later.
    option = self.option_class(*args, **kwargs)

src/ZConfig/tests/test_schema2html.py: 383 warnings
  /home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.1/src/ZConfig/sphinx.py:64: DeprecationWarning: nodes.Text: initialization argument "rawsource" is ignored and will be removed in Docutils 2.0.
    self._current_node += nodes.Text(' ' + text + ' ', text)

src/ZConfig/tests/test_schema2html.py::TestRst::test_parse_package
src/ZConfig/tests/test_schema2html.py::TestRst::test_parse_package_excluded_names
src/ZConfig/tests/test_schema2html.py::TestRst::test_parse_package_file
src/ZConfig/tests/test_schema2html.py::TestRst::test_parse_package_limited_names
src/ZConfig/tests/test_schema2html.py::TestRst::test_parse_package_schema
  /home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.1/src/ZConfig/tests/test_schema2html.py:116: DeprecationWarning: The frontend.OptionParser class will be replaced by a subclass of argparse.ArgumentParser in Docutils 0.21 or later.
    settings=docutils.frontend.OptionParser(

src/ZConfig/tests/test_schema2html.py::test_suite
  /usr/lib/python3.8/site-packages/_pytest/python.py:204: PytestReturnNotNoneWarning: Expected None, but src/ZConfig/tests/test_schema2html.py::test_suite returned <unittest.suite.TestSuite tests=[<unittest.suite.TestSuite tests=[<ZConfig.tests.test_schema2html.TestRst testMethod=test_description_dedent>, <ZConfig.tests.test_schema2html.TestRst testMethod=test_parse_package>, <ZConfig.tests.test_schema2html.TestRst testMethod=test_parse_package_excluded_names>, <ZConfig.tests.test_schema2html.TestRst testMethod=test_parse_package_file>, <ZConfig.tests.test_schema2html.TestRst testMethod=test_parse_package_limited_names>, <ZConfig.tests.test_schema2html.TestRst testMethod=test_parse_package_schema>]>, <unittest.suite.TestSuite tests=[<ZConfig.tests.test_schema2html.TestSchema2HTML testMethod=test_cover_all_schemas>, <ZConfig.tests.test_schema2html.TestSchema2HTML testMethod=test_cover_logging_components>, <ZConfig.tests.test_schema2html.TestSchema2HTML testMethod=test_html_section_example>, <ZConfig.tests.test_schema2html.TestSchema2HTML testMethod=test_rst_section_example>, <ZConfig.tests.test_schema2html.TestSchema2HTML testMethod=test_schema_only>, <ZConfig.tests.test_schema2html.TestSchema2HTML testMethod=test_schema_only_redirect>]>]>, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
    warnings.warn(

src/ZConfig/tests/test_schemaless.py::test_suite
  /usr/lib/python3.8/site-packages/_pytest/python.py:204: PytestReturnNotNoneWarning: Expected None, but src/ZConfig/tests/test_schemaless.py::test_suite returned <unittest.suite.TestSuite tests=[<unittest.suite.TestSuite tests=[<unittest.suite.TestSuite tests=[<ZConfig.tests.test_schemaless.TestSection testMethod=test_init_with_data>]>]>, <unittest.suite.TestSuite tests=[/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.1/src/ZConfig/schemaless.txt]>]>, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
    warnings.warn(

src/ZConfig/tests/test_subst.py::test_suite
  /usr/lib/python3.8/site-packages/_pytest/python.py:204: PytestReturnNotNoneWarning: Expected None, but src/ZConfig/tests/test_subst.py::test_suite returned <unittest.suite.TestSuite tests=[<unittest.suite.TestSuite tests=[<ZConfig.tests.test_subst.SubstitutionTestCase testMethod=test_edge_cases>, <ZConfig.tests.test_subst.SubstitutionTestCase testMethod=test_isname>, <ZConfig.tests.test_subst.SubstitutionTestCase testMethod=test_non_nesting>, <ZConfig.tests.test_subst.SubstitutionTestCase testMethod=test_simple_names>, <ZConfig.tests.test_subst.SubstitutionTestCase testMethod=test_syntax_errors>, <ZConfig.tests.test_subst.SubstitutionTestCase testMethod=test_undefined_names>]>]>, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
    warnings.warn(

src/ZConfig/tests/test_validator.py::test_suite
  /usr/lib/python3.8/site-packages/_pytest/python.py:204: PytestReturnNotNoneWarning: Expected None, but src/ZConfig/tests/test_validator.py::test_suite returned <unittest.suite.TestSuite tests=[<unittest.suite.TestSuite tests=[<ZConfig.tests.test_validator.TestValidator testMethod=test_bad_config>, <ZConfig.tests.test_validator.TestValidator testMethod=test_good_config>, <ZConfig.tests.test_validator.TestValidator testMethod=test_no_schema>, <ZConfig.tests.test_validator.TestValidator testMethod=test_schema_only>, <ZConfig.tests.test_validator.TestValidator testMethod=test_schema_only_redirect>]>]>, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= short test summary info ==========================================================================
SKIPPED [1] src/ZConfig/components/logger/tests/test_formatter.py:361: Only applies for Python 2.
SKIPPED [1] src/ZConfig/components/logger/tests/test_formatter.py:379: Only applies for Python 2.
SKIPPED [1] src/ZConfig/components/logger/tests/test_formatter.py:412: Only applies for Python 2.
SKIPPED [1] src/ZConfig/components/logger/tests/test_formatter.py:436: Only applies for Python 2.
FAILED src/ZConfig/tests/test_validator.py::TestValidator::test_schema_only - OSError: pytest: reading from stdin while output is captured!  Consider using `-s`.
========================================================= 1 failed, 355 passed, 4 skipped, 1774 warnings in 1.25s ==========================================================

Here is list of installed modules in build env

Package                       Version
----------------------------- -----------------
alabaster                     0.7.12
appdirs                       1.4.4
attrs                         22.1.0
Babel                         2.11.0
Brlapi                        0.8.3
build                         0.9.0
charset-normalizer            3.0.1
contourpy                     1.0.6
cssselect                     1.1.0
cycler                        0.11.0
distro                        1.8.0
dnspython                     2.2.1
docutils                      0.19
exceptiongroup                1.0.0
extras                        1.0.0
fixtures                      4.0.0
fonttools                     4.38.0
gpg                           1.17.1-unknown
idna                          3.4
imagesize                     1.4.1
importlib-metadata            5.1.0
iniconfig                     1.1.1
Jinja2                        3.1.2
kiwisolver                    1.4.4
libcomps                      0.1.19
louis                         3.24.0
lxml                          4.9.1
manuel                        1.12.4
MarkupSafe                    2.1.1
matplotlib                    3.6.2
numpy                         1.23.1
olefile                       0.46
packaging                     21.3
pbr                           5.9.0
pep517                        0.13.0
Pillow                        9.3.0
pip                           22.3.1
pluggy                        1.0.0
Pygments                      2.13.0
PyGObject                     3.42.2
pyparsing                     3.0.9
pytest                        7.2.0
python-dateutil               2.8.2
pytz                          2022.4
requests                      2.28.1
rpm                           4.17.0
scour                         0.38.2
setuptools                    65.6.3
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        5.3.0
sphinxcontrib-applehelp       1.0.2.dev20221204
sphinxcontrib-devhelp         1.0.2.dev20221204
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20221204
sphinxcontrib-programoutput   0.17
sphinxcontrib-qthelp          1.0.3.dev20221204
sphinxcontrib-serializinghtml 1.1.5
testtools                     2.5.0
tomli                         2.0.1
urllib3                       1.26.12
wheel                         0.38.4
zipp                          3.11.0
zope.event                    4.5.0
zope.exceptions               4.5
zope.interface                5.5.2

BTW it woud be good to move src/ZConfig/tests to tests/ to not install test suite with module code.

You have been told enough times that zopefoundation packages are not testable by pytest.
Please stop creating these kind of issues.