Skip to content

Commit

Permalink
Added four xfail tests for label position issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jlstevens committed Jul 20, 2023
1 parent e5c3743 commit b48f555
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions holoviews/tests/plotting/bokeh/test_multiaxis.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pytest
from holoviews.element import Curve
from .test_plot import TestBokehPlot, bokeh_renderer
from bokeh.models import LinearScale, LogScale, LinearAxis, LogAxis
Expand Down Expand Up @@ -199,3 +200,41 @@ def test_shared_multi_axes(self):

self.assertEqual((y_range.start, y_range.end), (5, 19))
self.assertEqual((extra_y_ranges['B'].start, extra_y_ranges['B'].end), (1, 13))

@pytest.mark.xfail
def test_swapped_position_label(self):
overlay = (Curve(range(10), vdims=['A']).opts(yaxis='right')
* Curve(range(10), vdims=['B']).opts(yaxis='left')
).opts(multi_y=True)
plot = bokeh_renderer.get_plot(overlay)

self.assertEqual(plot.state.yaxis[0].axis_label, 'B')
self.assertEqual(plot.state.yaxis[1].axis_label, 'A')


@pytest.mark.xfail
def test_swapped_position_custom_label(self):
overlay = (Curve(range(10), vdims=['A']).opts(yaxis='right', ylabel='A-custom')
* Curve(range(10), vdims=['B']).opts(yaxis='left', ylabel='B-custom')
).opts(multi_y=True)
plot = bokeh_renderer.get_plot(overlay)

self.assertEqual(plot.state.yaxis[0].axis_label, 'B-custom')
self.assertEqual(plot.state.yaxis[1].axis_label, 'A-custom')

@pytest.mark.xfail
def test_position_custom_size_label(self):
overlay = (Curve(range(10), vdims='A').opts(fontsize={'ylabel': '13pt'})
* Curve(range(10), vdims='B').opts(fontsize={'ylabel': '15pt'})).opts(multi_y=True)
plot = bokeh_renderer.get_plot(overlay)
self.assertEqual(plot.state.yaxis[0].axis_label_text_font_size, '13pt')
self.assertEqual(plot.state.yaxis[1].axis_label_text_font_size, '15pt')

@pytest.mark.xfail
def test_swapped_position_custom_size_label(self):
overlay = (Curve(range(10), vdims='A').opts(yaxis='right', fontsize={'ylabel': '13pt'})
* Curve(range(10), vdims='B').opts(yaxis='left',
fontsize={'ylabel': '15pt'})).opts(multi_y=True)
plot = bokeh_renderer.get_plot(overlay)
self.assertEqual(plot.state.yaxis[0].axis_label_text_font_size, '15pt')
self.assertEqual(plot.state.yaxis[1].axis_label_text_font_size, '13pt')

0 comments on commit b48f555

Please sign in to comment.