matthew-brett / sphinxtesters

Other
1 stars 1 forks source link

0.2.3: pytest id failing and `DeprecationWarning` warnings #3

Open kloczek opened 2 years ago

kloczek commented 2 years ago

I'm trying to package 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.

Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxtesters-0.2.3-13.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxtesters-0.2.3-13.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/sphinxtesters-0.2.3
collected 52 items

sphinxtesters/tests/test_modified_pagebuilder.py ............                                                                                                        [ 23%]
sphinxtesters/tests/test_pagebuilder.py ......F......                                                                                                                [ 48%]
sphinxtesters/tests/test_proj1.py ..                                                                                                                                 [ 51%]
sphinxtesters/tests/test_sources_builder.py .....................                                                                                                    [ 92%]
sphinxtesters/tests/test_testapp.py ..                                                                                                                               [ 96%]
sphinxtesters/tests/test_tmpdirs.py ..                                                                                                                               [100%]

================================================================================= FAILURES =================================================================================
___________________________________________________________________________ test_bad_pagebuilder ___________________________________________________________________________

    def test_bad_pagebuilder():

        class TestBadPageBuilder(PageBuilder):

            @classmethod
            def set_page_source(cls):
                cls.page_source = HERE

        # ConfigError as of Sphinx 1.6.6
        # ApplicationError as of 1.8.0b1
        # See imports.
        with pytest.raises((IOError, NoConfigError)):
>           TestBadPageBuilder.setup_class()

sphinxtesters/tests/test_pagebuilder.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
sphinxtesters/sphinxutils.py:222: in setup_class
    raise e
sphinxtesters/sphinxutils.py:213: in setup_class
    cls.build_app = TestApp(
sphinxtesters/sphinxutils.py:64: in __init__
    super(TestApp, self).__init__(*args, **kwargs)
/usr/lib/python3.8/site-packages/sphinx/application.py:202: in __init__
    self.config = Config.read(self.confdir, confoverrides or {}, self.tags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <class 'sphinx.config.Config'>, confdir = '/home/tkloczko/rpmbuild/BUILD/sphinxtesters-0.2.3/sphinxtesters/tests', overrides = {}
tags = <sphinx.util.tags.Tags object at 0x7f7734bd0a60>

    @classmethod
    def read(cls, confdir: str, overrides: Dict = None, tags: Tags = None) -> "Config":
        """Create a Config object from configuration file."""
        filename = path.join(confdir, CONFIG_FILENAME)
        if not path.isfile(filename):
>           raise ConfigError(__("config directory doesn't contain a conf.py file (%s)") %
                              confdir)
E           sphinx.errors.ConfigError: config directory doesn't contain a conf.py file (/home/tkloczko/rpmbuild/BUILD/sphinxtesters-0.2.3/sphinxtesters/tests)

/usr/lib/python3.8/site-packages/sphinx/config.py:163: ConfigError
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
Running Sphinx v4.5.0
============================================================================= warnings summary =============================================================================
sphinxtesters/tests/test_modified_pagebuilder.py::TestModifiedPageBuilder::test_build_error
sphinxtesters/tests/test_modified_pagebuilder.py::TestFModifiedPageBuilder::test_build_error
sphinxtesters/tests/test_modified_pagebuilder.py::TestAppendConf::test_build_error
sphinxtesters/tests/test_modified_pagebuilder.py::TestAddPage::test_build_error
sphinxtesters/tests/test_modified_pagebuilder.py::TestAddFPage::test_build_error
sphinxtesters/tests/test_proj1.py::TestProj1::test_build_error
  /usr/lib/python3.8/site-packages/_pytest/python.py:776: DeprecationWarning: ModifedPageBuilder deprecated, please use PageBuilder instead
    func(arg)

sphinxtesters/tests/test_modified_pagebuilder.py::test_bad_pagebuilder
  /home/tkloczko/rpmbuild/BUILD/sphinxtesters-0.2.3/sphinxtesters/tests/test_modified_pagebuilder.py:67: DeprecationWarning: ModifedPageBuilder deprecated, please use PageBuilder instead
    TestBadPageBuilder.setup_class()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= short test summary info ==========================================================================
FAILED sphinxtesters/tests/test_pagebuilder.py::test_bad_pagebuilder - sphinx.errors.ConfigError: config directory doesn't contain a conf.py file (/home/tkloczko/rpmbuil...
================================================================= 1 failed, 51 passed, 7 warnings in 4.81s =================================================================
matthew-brett commented 2 years ago

Thanks - I think this is fixed in current master. Would you mind testing?