Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure with sphinx 7.2.3 #19

Closed
pgalbraith opened this issue Aug 26, 2023 · 0 comments · Fixed by #22
Closed

Test failure with sphinx 7.2.3 #19

pgalbraith opened this issue Aug 26, 2023 · 0 comments · Fixed by #22

Comments

@pgalbraith
Copy link

With sphinx 7.2.3 I'm getting these test failures:

<?xml version="1.0" encoding="utf-8"?><testsuites><testsuite name="pytest" errors="0" failures="4" skipped="0" tests="4" time="0.340" timestamp="2023-08-26T12:02:22.347762" hostname="EDORAS"><testcase classname="tests.test_basic" name="test_basic" time="0.008"><failure message="AttributeError: 'path' object has no attribute 'mkdir'">sphinx_doctree = &lt;sphinx_pytest.plugin.CreateDoctree object at 0x00000151A3E7DFD0&gt;

    def test_basic(sphinx_doctree):
&gt;       result = sphinx_doctree("abc")

tests\test_basic.py:2: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src\sphinx_pytest\plugin.py:145: in __call__
    self._app_cls(
venv\Lib\site-packages\sphinx\testing\fixtures.py:183: in make
    app_: Any = SphinxTestApp(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = &lt;[AttributeError("'SphinxTestApp' object has no attribute 'builder'") raised in repr()] SphinxTestApp object at 0x151a3e7e110&gt;
buildername = 'doctree'
srcdir = path('C:\\Users\\Paul\\AppData\\Local\\Temp\\pytest-of-paul\\pytest-7\\test_basic0\\src')
builddir = path('C:\\Users\\Paul\\AppData\\Local\\Temp\\pytest-of-paul\\pytest-7\\test_basic0\\src\\_build')
freshenv = False, confoverrides = {}, status = &lt;_io.StringIO object at 0x00000151A3E38E50&gt;
warning = &lt;_io.StringIO object at 0x00000151A3E39240&gt;, tags = None, docutilsconf = None, parallel = 0

    def __init__(
        self,
        buildername: str = 'html',
        srcdir: _StrPath | None = None,
        builddir: _StrPath | None = None,
        freshenv: bool = False,
        confoverrides: dict | None = None,
        status: IO | None = None,
        warning: IO | None = None,
        tags: list[str] | None = None,
        docutilsconf: str | None = None,
        parallel: int = 0,
    ) -&gt; None:
        assert srcdir is not None
    
        self.docutils_conf_path = srcdir / 'docutils.conf'
        if docutilsconf is not None:
            self.docutils_conf_path.write_text(docutilsconf, encoding='utf8')
    
        if builddir is None:
            builddir = srcdir / '_build'
    
        confdir = srcdir
        outdir = builddir.joinpath(buildername)
&gt;       outdir.mkdir(parents=True, exist_ok=True)
E       AttributeError: 'path' object has no attribute 'mkdir'

venv\Lib\site-packages\sphinx\testing\util.py:106: AttributeError</failure></testcase><testcase classname="tests.test_basic" name="test_no_transforms" time="0.004"><failure message="AttributeError: 'path' object has no attribute 'mkdir'">sphinx_doctree_no_tr = &lt;sphinx_pytest.plugin.CreateDoctree object at 0x00000151A3F08C10&gt;

    def test_no_transforms(sphinx_doctree_no_tr):
        """Return the doctree, before any transforms have been applied."""
&gt;       result = sphinx_doctree_no_tr(".. _target:\n\nheader\n------\n")

tests\test_basic.py:11: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src\sphinx_pytest\plugin.py:145: in __call__
    self._app_cls(
venv\Lib\site-packages\sphinx\testing\fixtures.py:183: in make
    app_: Any = SphinxTestApp(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = &lt;[AttributeError("'SphinxTestApp' object has no attribute 'builder'") raised in repr()] SphinxTestApp object at 0x151a3f0b790&gt;
buildername = 'doctree'
srcdir = path('C:\\Users\\Paul\\AppData\\Local\\Temp\\pytest-of-paul\\pytest-7\\test_no_transforms0\\src')
builddir = path('C:\\Users\\Paul\\AppData\\Local\\Temp\\pytest-of-paul\\pytest-7\\test_no_transforms0\\src\\_build')
freshenv = False, confoverrides = {}, status = &lt;_io.StringIO object at 0x00000151A3F10820&gt;
warning = &lt;_io.StringIO object at 0x00000151A3F10D30&gt;, tags = None, docutilsconf = None, parallel = 0

    def __init__(
        self,
        buildername: str = 'html',
        srcdir: _StrPath | None = None,
        builddir: _StrPath | None = None,
        freshenv: bool = False,
        confoverrides: dict | None = None,
        status: IO | None = None,
        warning: IO | None = None,
        tags: list[str] | None = None,
        docutilsconf: str | None = None,
        parallel: int = 0,
    ) -&gt; None:
        assert srcdir is not None
    
        self.docutils_conf_path = srcdir / 'docutils.conf'
        if docutilsconf is not None:
            self.docutils_conf_path.write_text(docutilsconf, encoding='utf8')
    
        if builddir is None:
            builddir = srcdir / '_build'
    
        confdir = srcdir
        outdir = builddir.joinpath(buildername)
&gt;       outdir.mkdir(parents=True, exist_ok=True)
E       AttributeError: 'path' object has no attribute 'mkdir'

venv\Lib\site-packages\sphinx\testing\util.py:106: AttributeError</failure></testcase><testcase classname="tests.test_basic" name="test_with_transforms" time="0.003"><failure message="AttributeError: 'path' object has no attribute 'mkdir'">sphinx_doctree = &lt;sphinx_pytest.plugin.CreateDoctree object at 0x00000151A3EE1210&gt;

    def test_with_transforms(sphinx_doctree):
        """Return the doctree, after transforms (but not post-transforms)."""
&gt;       result = sphinx_doctree(".. _target:\n\nheader\n------\n")

tests\test_basic.py:26: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src\sphinx_pytest\plugin.py:145: in __call__
    self._app_cls(
venv\Lib\site-packages\sphinx\testing\fixtures.py:183: in make
    app_: Any = SphinxTestApp(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = &lt;[AttributeError("'SphinxTestApp' object has no attribute 'builder'") raised in repr()] SphinxTestApp object at 0x151a3ee27d0&gt;
buildername = 'doctree'
srcdir = path('C:\\Users\\Paul\\AppData\\Local\\Temp\\pytest-of-paul\\pytest-7\\test_with_transforms0\\src')
builddir = path('C:\\Users\\Paul\\AppData\\Local\\Temp\\pytest-of-paul\\pytest-7\\test_with_transforms0\\src\\_build')
freshenv = False, confoverrides = {}, status = &lt;_io.StringIO object at 0x00000151A3E39240&gt;
warning = &lt;_io.StringIO object at 0x00000151A3F10940&gt;, tags = None, docutilsconf = None, parallel = 0

    def __init__(
        self,
        buildername: str = 'html',
        srcdir: _StrPath | None = None,
        builddir: _StrPath | None = None,
        freshenv: bool = False,
        confoverrides: dict | None = None,
        status: IO | None = None,
        warning: IO | None = None,
        tags: list[str] | None = None,
        docutilsconf: str | None = None,
        parallel: int = 0,
    ) -&gt; None:
        assert srcdir is not None
    
        self.docutils_conf_path = srcdir / 'docutils.conf'
        if docutilsconf is not None:
            self.docutils_conf_path.write_text(docutilsconf, encoding='utf8')
    
        if builddir is None:
            builddir = srcdir / '_build'
    
        confdir = srcdir
        outdir = builddir.joinpath(buildername)
&gt;       outdir.mkdir(parents=True, exist_ok=True)
E       AttributeError: 'path' object has no attribute 'mkdir'

venv\Lib\site-packages\sphinx\testing\util.py:106: AttributeError</failure></testcase><testcase classname="tests.test_basic" name="test_html_builder" time="0.003"><failure message="AttributeError: 'path' object has no attribute 'mkdir'">sphinx_doctree = &lt;sphinx_pytest.plugin.CreateDoctree object at 0x00000151A3F89E10&gt;

    def test_html_builder(sphinx_doctree):
        sphinx_doctree.buildername = "html"
&gt;       result = sphinx_doctree(".. only:: html\n\n   abc\n\n.. only:: latex\n\n   xyz\n")

tests\test_basic.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src\sphinx_pytest\plugin.py:145: in __call__
    self._app_cls(
venv\Lib\site-packages\sphinx\testing\fixtures.py:183: in make
    app_: Any = SphinxTestApp(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = &lt;[AttributeError("'SphinxTestApp' object has no attribute 'builder'") raised in repr()] SphinxTestApp object at 0x151a3f88c50&gt;
buildername = 'html'
srcdir = path('C:\\Users\\Paul\\AppData\\Local\\Temp\\pytest-of-paul\\pytest-7\\test_html_builder0\\src')
builddir = path('C:\\Users\\Paul\\AppData\\Local\\Temp\\pytest-of-paul\\pytest-7\\test_html_builder0\\src\\_build')
freshenv = False, confoverrides = {}, status = &lt;_io.StringIO object at 0x00000151A3F10DC0&gt;
warning = &lt;_io.StringIO object at 0x00000151A3F11000&gt;, tags = None, docutilsconf = None, parallel = 0

    def __init__(
        self,
        buildername: str = 'html',
        srcdir: _StrPath | None = None,
        builddir: _StrPath | None = None,
        freshenv: bool = False,
        confoverrides: dict | None = None,
        status: IO | None = None,
        warning: IO | None = None,
        tags: list[str] | None = None,
        docutilsconf: str | None = None,
        parallel: int = 0,
    ) -&gt; None:
        assert srcdir is not None
    
        self.docutils_conf_path = srcdir / 'docutils.conf'
        if docutilsconf is not None:
            self.docutils_conf_path.write_text(docutilsconf, encoding='utf8')
    
        if builddir is None:
            builddir = srcdir / '_build'
    
        confdir = srcdir
        outdir = builddir.joinpath(buildername)
&gt;       outdir.mkdir(parents=True, exist_ok=True)
E       AttributeError: 'path' object has no attribute 'mkdir'

venv\Lib\site-packages\sphinx\testing\util.py:106: AttributeError</failure></testcase></testsuite></testsuites>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant