Skip to content

Commit b9a8834

Browse files
marcofavoritomarcofavoritobi
authored andcommitted
test: skip flaky test TestPlotLossesMethodNum on Windows
The test TestPlotLossesMethodNum showed to be flaky on Windows, see https://github.com/bancaditalia/black-it/actions/runs/5952400728/job/16144300857?pr=45#step:6:2581 Error output: ______________ TestPlotLossesMethodNum.test_run_by_method_num[3] ______________ self = <tests.test_plot.test_plot_results.TestPlotLossesMethodNum object at 0x000002399D891F30> method_num = 3 @pytest.mark.parametrize("method_num", list(range(5))) def test_run_by_method_num( self, method_num: int ) -> None: # pylint: disable=arguments-differ """Run the test for all method numbers.""" self.expected_image = ( PLOT_DIR / f"plot_losses_method_num_{method_num}-expected.png" ) self.args = [self.saving_folder, method_num] > super().run() tests\test_plot\test_plot_results.py:86: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests\test_plot\base.py:43: in run self.plotting_function.__func__(*self.args) # type: ignore black_it\plot\plot_results.py:195: in plot_losses_method_num g = sns.pairplot( .tox\py-nb\lib\site-packages\seaborn\axisgrid.py:2114: in pairplot grid = PairGrid(data, vars=vars, x_vars=x_vars, y_vars=y_vars, hue=hue, .tox\py-nb\lib\site-packages\seaborn\axisgrid.py:1274: in __init__ fig = plt.figure(figsize=figsize) .tox\py-nb\lib\site-packages\matplotlib\_api\deprecation.py:454: in wrapper return func(*args, **kwargs) .tox\py-nb\lib\site-packages\matplotlib\pyplot.py:840: in figure manager = new_figure_manager( .tox\py-nb\lib\site-packages\matplotlib\pyplot.py:384: in new_figure_manager return _get_backend_mod().new_figure_manager(*args, **kwargs) .tox\py-nb\lib\site-packages\matplotlib\backend_bases.py:3574: in new_figure_manager return cls.new_figure_manager_given_figure(num, fig) .tox\py-nb\lib\site-packages\matplotlib\backend_bases.py:3579: in new_figure_manager_given_figure return cls.FigureCanvas.new_manager(figure, num) .tox\py-nb\lib\site-packages\matplotlib\backend_bases.py:1742: in new_manager return cls.manager_class.create_with_canvas(cls, figure, num) .tox\py-nb\lib\site-packages\matplotlib\backends\_backend_tk.py:483: in create_with_canvas window = tk.Tk(className="matplotlib") _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <tkinter.Tk object .>, screenName = None, baseName = 'pytest.EXE' className = 'matplotlib', useTk = True, sync = False, use = None def __init__(self, screenName=None, baseName=None, className='Tk', useTk=True, sync=False, use=None): """Return a new top level widget on screen SCREENNAME. A new Tcl interpreter will be created. BASENAME will be used for the identification of the profile file (see readprofile). It is constructed from sys.argv[0] without extensions if None is given. CLASSNAME is the name of the widget class.""" self.master = None self.children = {} self._tkloaded = False # to avoid recursions in the getattr code in case of failure, we # ensure that self.tk is always _something_. self.tk = None if baseName is None: import os baseName = os.path.basename(sys.argv[0]) baseName, ext = os.path.splitext(baseName) if ext not in ('.py', '.pyc'): baseName = baseName + ext interactive = False > self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) E _tkinter.TclError: invalid command name "tcl_findLibrary" C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\tkinter\__init__.py:2299: TclError
1 parent 5e772a0 commit b9a8834

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/test_plot/test_plot_results.py

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
)
3232
from tests.conftest import EXAMPLE_SAVING_FOLDER, PLOT_DIR
3333
from tests.test_plot.base import BasePlotResultsTest
34+
from tests.utils.base import skip_on_windows
3435

3536

3637
class TestPlotConvergence(
@@ -60,6 +61,7 @@ class TestPlotSampling(BasePlotResultsTest): # pylint: disable=too-few-public-m
6061
expected_image = PLOT_DIR / "plot_sampling-expected.png"
6162

6263

64+
@skip_on_windows
6365
class TestPlotLossesMethodNum(
6466
BasePlotResultsTest
6567
): # pylint: disable=too-few-public-methods

0 commit comments

Comments
 (0)