From: Vladimír Vondruš Date: Thu, 7 May 2020 18:11:24 +0000 (+0200) Subject: Adapt to matplotlib output changes as well. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=b463e2d0cde27b44ae10259794a78f333daf2287;p=blog.git Adapt to matplotlib output changes as well. --- diff --git a/plugins/m/test/plots/page-30.html b/plugins/m/test/plots/page-30.html new file mode 100644 index 00000000..6939e60d --- /dev/null +++ b/plugins/m/test/plots/page-30.html @@ -0,0 +1,687 @@ + + + + + m.plots | A Pelican Blog + + + + + + +
+
+
+
+
+
+

m.plots

+ +

Note: the test uses DejaVu Sans instead of Source Sans Pro in order to have +predictable rendering on the CIs.

+
+ + + + + + + + + + 15.0 meters, i guess? + + + 30.0 meters, i guess? + + + + + + + + + + + + + + 0 + + + + + + + + + + 5 + + + + + + + + + + 10 + + + + + + + + + + 15 + + + + + + + + + + 20 + + + + + + + + + + 25 + + + + + + + + + + 30 + + + + meters, i guess? + + + + + + + + + + + + + + First + + + + + + + + + + Second + + + + + A plot with a single color + + + + + + + + + +
+
+ + + + + + + + + + 3.0 ± 0.1 Mondays + + + 4.0 ± 2.1 Mondays + + + 5.0 ± 1.0 Mondays + + + + + + + + + + + + + + 0 + + + + + + + + + + 1 + + + + + + + + + + 2 + + + + + + + + + + 3 + + + + + + + + + + 4 + + + + + + + + + + 5 + + + + + + + + + + 6 + + + + Mondays + + + + + + + + + + + + + + January + + + + + + + + + + + February + + + + + + + + + + March + + + + + + + + + + + + + + + + + + + + + + + + + + + + + a paradise + + + + hell! + + + A plot with separate colors, extra labels, error bars and custom height + + + + + + + + + +
+
+ + + + + + + + + + 111.9 kB + + + 74.4 kB + + + 52.1 kB + + + 731.2 kB + + + 226.3 kB + + + 226.0 kB + + + + + + + + + + + + + + 0 + + + + + + + + + + 100 + + + + + + + + + + 200 + + + + + + + + + + 300 + + + + + + + + + + 400 + + + + + + + + + + 500 + + + + + + + + + + 600 + + + + + + + + + + 700 + + + + + + + + + + 800 + + + + kB + + + + + + + + + + + + + + A + + + + + + + + + + B + + + + + + + + + + C + + + + + Stacked plot + + + + + + + + + +
+
+ + + + + + + + + + 111.9 ± 25.0 kB + + + 74.4 ± 15.3 kB + + + 731.2 ± 200.0 kB + + + 226.3 ± 5.0 kB + + + + + + + + + + + + + + 0 + + + + + + + + + + 200 + + + + + + + + + + 400 + + + + + + + + + + 600 + + + + + + + + + + 800 + + + + + + + + + + 1000 + + + + kB + + + + + + + + + + + + + + A + + + + + + + + + + B + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Stacked plot with errors and full colors + + + + + + + + + +
+ +
+
+
+
+
+ + diff --git a/plugins/m/test/plots/page.html b/plugins/m/test/plots/page.html index 6939e60d..f8ab90ad 100644 --- a/plugins/m/test/plots/page.html +++ b/plugins/m/test/plots/page.html @@ -170,16 +170,16 @@ div.m-plot svg { font-family: DejaVu Sans; } - + 3.0 ± 0.1 Mondays - + 4.0 ± 2.1 Mondays - + 5.0 ± 1.0 Mondays - + @@ -198,65 +198,65 @@ div.m-plot svg { font-family: DejaVu Sans; } - + - 1 + 1 - + - 2 + 2 - + - 3 + 3 - + - 4 + 4 - + - 5 + 5 - + - 6 + 6 - Mondays + Mondays @@ -291,31 +291,31 @@ div.m-plot svg { font-family: DejaVu Sans; } - March + March - - - + + + - - - - + + + + - - - - + + + + @@ -327,13 +327,13 @@ div.m-plot svg { font-family: DejaVu Sans; } hell! - A plot with separate colors, extra labels, error bars and custom height + A plot with separate colors, extra labels, error bars and custom height - - + + diff --git a/plugins/m/test/test_plots.py b/plugins/m/test/test_plots.py index a7338080..b7d57141 100644 --- a/plugins/m/test/test_plots.py +++ b/plugins/m/test/test_plots.py @@ -42,9 +42,11 @@ class Plots(PelicanPluginTestCase): }) # FUCK this is annoying - if LooseVersion(matplotlib.__version__) >= LooseVersion("3.0"): + if LooseVersion(matplotlib.__version__) >= LooseVersion('3.2'): + self.assertEqual(*self.actual_expected_contents('page.html')) + elif LooseVersion(matplotlib.__version__) >= LooseVersion('3.0'): if LooseVersion(sys.version) >= LooseVersion("3.6"): - self.assertEqual(*self.actual_expected_contents('page.html')) + self.assertEqual(*self.actual_expected_contents('page-30.html')) else: self.assertEqual(*self.actual_expected_contents('page.html', 'page-py35.html')) else: