Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

0.10.1: pytest is failing #975

Copy link
Copy link
Open
Open
Copy link
@kloczek

Description

@kloczek
Issue body actions

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-sphinx-gallery-0.10.1-4.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinx-gallery-0.10.1-4.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/sphinx-gallery-0.10.1, configfile: setup.cfg
collected 194 items

sphinx_gallery/tests/test_backreferences.py .......                                                                                                                  [  3%]
sphinx_gallery/tests/test_binder.py ..                                                                                                                               [  4%]
sphinx_gallery/tests/test_docs_resolv.py ...                                                                                                                         [  6%]
sphinx_gallery/tests/test_full.py .................................                                                                                                  [ 23%]
sphinx_gallery/tests/test_full_noexec.py .                                                                                                                           [ 23%]
sphinx_gallery/tests/test_gen_gallery.py ................................                                                                                            [ 40%]
sphinx_gallery/tests/test_gen_rst.py ..............................................................FFFF.                                                             [ 74%]
sphinx_gallery/tests/test_load_style.py .                                                                                                                            [ 75%]
sphinx_gallery/tests/test_notebook.py ..............                                                                                                                 [ 82%]
sphinx_gallery/tests/test_py_source_parser.py .................                                                                                                      [ 91%]
sphinx_gallery/tests/test_scrapers.py ...s.......                                                                                                                    [ 96%]
sphinx_gallery/tests/test_sorting.py .                                                                                                                               [ 97%]
sphinx_gallery/tests/test_sphinx_compatibility.py ...                                                                                                                [ 98%]
sphinx_gallery/tests/test_utils.py ..                                                                                                                                [100%]

================================================================================= FAILURES =================================================================================
______________________________________________________________________ TestLoggingTee.test_full_line _______________________________________________________________________

self = <sphinx_gallery.tests.test_gen_rst.TestLoggingTee object at 0x7f532b21a730>, log_collector = <sphinx_gallery.tests.conftest.FakeSphinxApp object at 0x7f518504a490>

    def test_full_line(self, log_collector):
        # A full line is output immediately.
        self.tee.write('Output\n')
        self.tee.flush()
        assert self.output_file.getvalue() == 'Output\n'
>       assert len(log_collector.calls['verbose']) == 2
E       assert 0 == 2
E        +  where 0 = len([])

sphinx_gallery/tests/test_gen_rst.py:897: AssertionError
______________________________________________________________ TestLoggingTee.test_incomplete_line_with_flush ______________________________________________________________

self = <sphinx_gallery.tests.test_gen_rst.TestLoggingTee object at 0x7f532b21a910>, log_collector = <sphinx_gallery.tests.conftest.FakeSphinxApp object at 0x7f517f000070>

    def test_incomplete_line_with_flush(self, log_collector):
        # An incomplete line ...
        self.tee.write('Output')
        assert self.output_file.getvalue() == 'Output'
>       assert len(log_collector.calls['verbose']) == 1
E       assert 0 == 1
E        +  where 0 = len([])

sphinx_gallery/tests/test_gen_rst.py:905: AssertionError
___________________________________________________________ TestLoggingTee.test_incomplete_line_with_more_output ___________________________________________________________

self = <sphinx_gallery.tests.test_gen_rst.TestLoggingTee object at 0x7f532b21aa00>, log_collector = <sphinx_gallery.tests.conftest.FakeSphinxApp object at 0x7f519cd60f70>

    def test_incomplete_line_with_more_output(self, log_collector):
        # An incomplete line ...
        self.tee.write('Output')
        assert self.output_file.getvalue() == 'Output'
>       assert len(log_collector.calls['verbose']) == 1
E       assert 0 == 1
E        +  where 0 = len([])

sphinx_gallery/tests/test_gen_rst.py:917: AssertionError
______________________________________________________________________ TestLoggingTee.test_multi_line ______________________________________________________________________

self = <sphinx_gallery.tests.test_gen_rst.TestLoggingTee object at 0x7f532b21ab50>, log_collector = <sphinx_gallery.tests.conftest.FakeSphinxApp object at 0x7f5184e65eb0>

    def test_multi_line(self, log_collector):
        self.tee.write('first line\rsecond line\nthird line')
        assert (self.output_file.getvalue() ==
                'first line\rsecond line\nthird line')
        verbose_calls = log_collector.calls['verbose']
>       assert len(verbose_calls) == 3
E       assert 0 == 3
E        +  where 0 = len([])

sphinx_gallery/tests/test_gen_rst.py:932: AssertionError
============================================================================= warnings summary =============================================================================
sphinx_gallery/tests/test_backreferences.py: 6 warnings
sphinx_gallery/tests/test_full.py: 140 warnings
sphinx_gallery/tests/test_full_noexec.py: 28 warnings
sphinx_gallery/tests/test_gen_gallery.py: 192 warnings
sphinx_gallery/tests/test_gen_rst.py: 68 warnings
sphinx_gallery/tests/test_notebook.py: 4 warnings
sphinx_gallery/tests/test_py_source_parser.py: 2 warnings
sphinx_gallery/tests/test_sorting.py: 4 warnings
  /home/tkloczko/rpmbuild/BUILD/sphinx-gallery-0.10.1/sphinx_gallery/py_source_parser.py:105: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if LooseVersion(sys.version) >= LooseVersion('3.7'):

sphinx_gallery/tests/test_full.py: 23 warnings
sphinx_gallery/tests/test_full_noexec.py: 14 warnings
sphinx_gallery/tests/test_gen_gallery.py: 50 warnings
sphinx_gallery/tests/test_gen_rst.py: 17 warnings
  /home/tkloczko/rpmbuild/BUILD/sphinx-gallery-0.10.1/sphinx_gallery/utils.py:64: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
    img = img.resize((width_sc, height_sc), Image.BICUBIC)

sphinx_gallery/tests/test_full.py::test_timings
sphinx_gallery/tests/test_full.py::test_timings
  /home/tkloczko/rpmbuild/BUILD/sphinx-gallery-0.10.1/sphinx_gallery/scrapers.py:228: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if LooseVersion(matplotlib.__version__) >= LooseVersion('3.3.1') and \

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================================================================== slowest 5 durations ============================================================================
14.86s setup    sphinx_gallery/tests/test_full.py::test_timings
7.19s call     sphinx_gallery/tests/test_full.py::test_rebuild
5.20s setup    sphinx_gallery/tests/test_full_noexec.py::test_dummy_image
4.49s call     sphinx_gallery/tests/test_full.py::test_junit
0.58s call     sphinx_gallery/tests/test_gen_gallery.py::test_failing_examples_raise_exception
========================================================================= short test summary info ==========================================================================
SKIPPED [1] sphinx_gallery/tests/test_scrapers.py:118: Mayavi not installed
FAILED sphinx_gallery/tests/test_gen_rst.py::TestLoggingTee::test_full_line - assert 0 == 2
FAILED sphinx_gallery/tests/test_gen_rst.py::TestLoggingTee::test_incomplete_line_with_flush - assert 0 == 1
FAILED sphinx_gallery/tests/test_gen_rst.py::TestLoggingTee::test_incomplete_line_with_more_output - assert 0 == 1
FAILED sphinx_gallery/tests/test_gen_rst.py::TestLoggingTee::test_multi_line - assert 0 == 3
========================================================= 4 failed, 189 passed, 1 skipped, 550 warnings in 42.42s ==========================================================

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.