Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

check_figures_equal regression from 3.2.0 to 3.2.1 #16916

Closed
Milestone
@andrewzwicky

Description

@andrewzwicky

Bug report

Bug summary

Previously, tests using check_figures_equal worked as expected on V3.2.0. When upgrading to V3.2.1, with no other changes to system, tests now fail with the error message:

file c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\matplotlib\testing\decorators.py, line 393          @pytest.mark.parametrize("ext", extensions)          def wrapper(*args, **kwargs):E       fixture 'test_figure' not found>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, get_preparsed_fingerprint_game, get_preparsed_timeline_games, get_test_events_folder, get_test_events_folder_in_progress, get_test_json_games_folder, get_test_replay_pickle_folder, get_test_unparsed_folder, get_unparsed_test_games, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id>       use 'pytest --fixtures [testpath]' for help on them.

Code for reproduction

@check_figures_equal(extensions=["png"])deftest_mpl_321(test_figure,reference_figure):reference_figure.set_size_inches(8,8)ref_ax=reference_figure.subplots()ref_ax.set_title("Test Title")ref_ax.pie(        [1,2,3,4,4],labels=["A","B","C","D","E"],    )test_figure.set_size_inches(8,8)test_ax=test_figure.subplots()test_ax.set_title("Test Title")test_ax.pie(        [1,2,3,4,4],labels=["A","B","C","D","E"],    )

Actual outcome

This is the console output showing:

  1. The test failing with V3.2.1
  2. Uninstall V3.2.1 and installing V3.2.0
  3. The test passing.
PS C:\Users\Andrew\Workspace\TripleAgent> pytest -k test_mpl_321============================================================================================================================ test session starts =============================================================================================================================platform win32 -- Python 3.7.5, pytest-4.5.0, py-1.8.0, pluggy-0.9.0rootdir: C:\Users\Andrew\Workspace\TripleAgent, inifile: setup.cfgplugins: xdist-1.29.0, forked-1.0.2, cov-2.7.1collected 1223 items / 1222 deselected / 1 selectedtriple_agent\tests\test_plot_types.py E                                                                                                                                                                                                                                 [100%]=================================================================================================================================== ERRORS ===================================================================================================================================____________________________________________________________________________________________________________________ ERROR at setup of test_mpl_321[png] _____________________________________________________________________________________________________________________file c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\matplotlib\testing\decorators.py, line 393          @pytest.mark.parametrize("ext", extensions)          def wrapper(*args, **kwargs):E       fixture 'test_figure' not found>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, get_preparsed_fingerprint_game, get_preparsed_timeline_games, get_test_events_folder, get_test_events_folder_in_progress, get_test_json_games_folder, get_test_replay_pickle_folder, get_test_unparsed_folder, get_unparsed_test_games, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id>       use 'pytest --fixtures [testpath]' for help on them.c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\matplotlib\testing\decorators.py:393============================================================================================================================== warnings summary ==============================================================================================================================c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\nbformat\notebooknode.py:4  c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\nbformat\notebooknode.py:4: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working    from collections import Mappingc:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\jinja2\utils.py:485  c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\jinja2\utils.py:485: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working    from collections import MutableMappingc:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\nbconvert\exporters\exporter_locator.py:28  c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\nbconvert\exporters\exporter_locator.py:28: DeprecationWarning: `nbconvert.exporters.exporter_locator` is deprecated in favor of `nbconvert.exporters.base` since nbconvert 5.0.    DeprecationWarning)-- Docs: https://docs.pytest.org/en/latest/warnings.html=========================================================================================================== 1222 deselected, 3 warnings, 1 error in 17.47 seconds ============================================================================================================

Uninstall V3.2.1 -> Install V.3.2.0

PS C:\Users\Andrew\Workspace\TripleAgent> pip uninstall matplotlibFound existing installation: matplotlib 3.2.1Uninstalling matplotlib-3.2.1:  Would remove:    c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\matplotlib-3.2.1-py3.7-nspkg.pth    c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\matplotlib-3.2.1.dist-info\*    c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\matplotlib\*    c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\mpl_toolkits\axes_grid1\*    c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\mpl_toolkits\axes_grid\*    c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\mpl_toolkits\axisartist\*    c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\mpl_toolkits\mplot3d\*    c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\mpl_toolkits\tests\*    c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\pylab.pyProceed (y/n)? y  Successfully uninstalled matplotlib-3.2.1PS C:\Users\Andrew\Workspace\TripleAgent> pip install matplotlib==3.2.0Collecting matplotlib==3.2.0  Using cached matplotlib-3.2.0-cp37-cp37m-win_amd64.whl (9.2 MB)Requirement already satisfied: numpy>=1.11 in c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages (from matplotlib==3.2.0) (1.16.3)Requirement already satisfied: python-dateutil>=2.1 in c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages (from matplotlib==3.2.0) (2.8.0)Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages (from matplotlib==3.2.0) (1.0.1)Requirement already satisfied: cycler>=0.10 in c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages (from matplotlib==3.2.0) (0.10.0)Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages (from matplotlib==3.2.0) (2.4.0)Requirement already satisfied: six>=1.5 in c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages (from python-dateutil>=2.1->matplotlib==3.2.0) (1.12.0)Requirement already satisfied: setuptools in c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages (from kiwisolver>=1.0.1->matplotlib==3.2.0) (40.8.0)Installing collected packages: matplotlibSuccessfully installed matplotlib-3.2.0
PS C:\Users\Andrew\Workspace\TripleAgent> pytest -k test_mpl_321============================================================================================================================ test session starts =============================================================================================================================platform win32 -- Python 3.7.5, pytest-4.5.0, py-1.8.0, pluggy-0.9.0rootdir: C:\Users\Andrew\Workspace\TripleAgent, inifile: setup.cfgplugins: xdist-1.29.0, forked-1.0.2, cov-2.7.1collected 1223 items / 1222 deselected / 1 selectedtriple_agent\tests\test_plot_types.py .                                                                                                                                                                                                                                 [100%]============================================================================================================================== warnings summary ==============================================================================================================================c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\nbformat\notebooknode.py:4  c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\nbformat\notebooknode.py:4: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working    from collections import Mappingc:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\jinja2\utils.py:485  c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\jinja2\utils.py:485: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working    from collections import MutableMappingc:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\nbconvert\exporters\exporter_locator.py:28  c:\users\andrew\appdata\local\programs\python\python37\lib\site-packages\nbconvert\exporters\exporter_locator.py:28: DeprecationWarning: `nbconvert.exporters.exporter_locator` is deprecated in favor of `nbconvert.exporters.base` since nbconvert 5.0.    DeprecationWarning)-- Docs: https://docs.pytest.org/en/latest/warnings.html=========================================================================================================== 1 passed, 1222 deselected, 3 warnings in 20.79 seconds ===========================================================================================================

Expected outcome

Tests that were previously working are not expected to start failing on version update? I might be missing something, but I didn't see anything in update notes about needing to refactor tests.

Matplotlib version

  • Operating system: WIN10
  • Matplotlib version: V3.2.1
  • Matplotlib backend (print(matplotlib.get_backend())): TkAgg
  • Python version: 3.7.5
  • Jupyter version (if applicable):
  • Other libraries:
absl-py               0.7.1Adafruit-GPIO         1.0.3Adafruit-PureIO       0.2.3apipkg                1.5appdirs               1.4.3astor                 0.7.1astroid               2.2.5atomicwrites          1.3.0attrs                 19.1.0backcall              0.1.0beautifulsoup4        4.7.1black                 19.10b0bleach                3.1.0bs4                   0.0.1certifi               2018.11.29chardet               3.0.4Click                 7.0colorama              0.4.1colored               1.3.93coverage              4.5.3cycler                0.10.0decorator             4.3.0defusedxml            0.5.0entrypoints           0.3execnet               1.6.0future                0.17.1gast                  0.2.2grpcio                1.20.1gym                   0.12.1h5py                  2.9.0idna                  2.8ipykernel             5.1.0ipython               7.2.0ipython-genutils      0.2.0ipywidgets            7.4.2iso-639               0.4.5iso3166               0.9isodate               0.6.0isort                 4.3.17jedi                  0.13.2Jinja2                2.10.1json5                 0.9.3jsonpickle            1.2jsonschema            3.0.1jupyter-client        5.2.4jupyter-console       6.0.0jupyter-core          4.4.0jupyterlab            2.0.1jupyterlab-server     1.0.7Keras                 2.2.4Keras-Applications    1.0.7Keras-Preprocessing   1.0.9kiwisolver            1.0.1lazy-object-proxy     1.3.1lxml                  4.3.2Markdown              3.1MarkupSafe            1.1.1matplotlib            3.2.0mccabe                0.6.1mistune               0.8.4mock                  2.0.0more-itertools        7.0.0mss                   4.0.3nbconvert             5.4.1nbformat              4.4.0nose                  1.3.7notebook              5.7.8numpy                 1.16.3opencv-contrib-python 4.0.0.21opencv-python         4.1.0.25pandas                0.25.0pandocfilters         1.4.2parso                 0.3.1pathspec              0.6.0pbr                   5.2.0pickleshare           0.7.5Pillow                5.4.1pip                   20.0.2pluggy                0.9.0prometheus-client     0.6.0prompt-toolkit        2.0.7protobuf              3.7.1py                    1.8.0py-spy                0.1.10PyAutoGUI             0.9.42pycryptodome          3.7.2PyGetWindow           0.0.4pyglet                1.3.2Pygments              2.3.1pylint                2.3.1PyMsgBox              1.0.6pyparsing             2.4.0pypiwin32             223PyRect                0.1.4pyrsistent            0.14.11PyScreeze             0.1.20PySocks               1.6.8pytesseract           0.2.6pytest                4.5.0pytest-cov            2.7.1pytest-forked         1.0.2pytest-runner         4.4pytest-xdist          1.29.0python-dateutil       2.8.0PyTweening            1.0.3pytz                  2019.2pywin32               224pywinpty              0.5.5PyYAML                5.1pyzmq                 18.0.1qtconsole             4.4.3regex                 2019.8.19requests              2.21.0scipy                 1.3.0selenium              3.141.0Send2Trash            1.5.0setuptools            40.8.0simplejson            3.17.0six                   1.12.0snakeviz              2.0.0soupsieve             1.8spotipy               2.4.4streamlink            1.3.0tabulate              0.8.3tensorboard           1.13.1tensorflow            1.13.1tensorflow-estimator  1.13.0termcolor             1.1.0terminado             0.8.2testpath              0.4.2toml                  0.10.0tornado               6.0.4traitlets             4.3.2typed-ast             1.4.0urllib3               1.24.1vulture               1.0wcwidth               0.1.7webencodings          0.5.1websocket-client      0.54.0Werkzeug              0.15.2wheel                 0.33.1widgetsnbextension    3.4.2wrapt                 1.11.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp