many packages are not ready for bokeh3 yet. For example panel and the holoviews family: https://github.com/holoviz/panel/issues/4097 They say it will take some time. OBS-URL: https://build.opensuse.org/request/show/1037172 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-bokeh2?expand=0&rev=1
43 lines
1.6 KiB
Diff
43 lines
1.6 KiB
Diff
From b86d5458cbf6d371013a8ced744b262460005e23 Mon Sep 17 00:00:00 2001
|
|
From: Mateusz Paprocki <mattpap@gmail.com>
|
|
Date: Wed, 6 Jul 2022 14:59:48 +0200
|
|
Subject: [PATCH] Robustify a unit test of Image.transform()
|
|
|
|
---
|
|
tests/unit/bokeh/core/property/test_visual.py | 14 +++++++++-----
|
|
1 file changed, 9 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/tests/unit/bokeh/core/property/test_visual.py b/tests/unit/bokeh/core/property/test_visual.py
|
|
index 3f293642b56..37620d35c1d 100644
|
|
--- a/tests/unit/bokeh/core/property/test_visual.py
|
|
+++ b/tests/unit/bokeh/core/property/test_visual.py
|
|
@@ -21,6 +21,7 @@
|
|
import datetime
|
|
from io import BytesIO
|
|
from pathlib import Path
|
|
+from typing import Literal
|
|
|
|
# External imports
|
|
import numpy as np
|
|
@@ -284,12 +285,15 @@ def test_transform_numpy(self) -> None:
|
|
assert prop.transform(data) == expected
|
|
|
|
@pytest.mark.parametrize('typ', ('png', 'gif', 'tiff'))
|
|
- def test_transform_PIL(self, typ) -> None:
|
|
+ def test_transform_PIL(self, typ: Literal["png", "gif", "tiff"]) -> None:
|
|
image = PIL.Image.new("RGBA", size=(50, 50), color=(155, 0, 0))
|
|
- out = BytesIO()
|
|
- image.save(out, typ)
|
|
- value = PIL.Image.open(out)
|
|
- expected = "data:image/%s;base64," % typ + base64.b64encode(out.getvalue()).decode('ascii')
|
|
+ out0 = BytesIO()
|
|
+ image.save(out0, typ)
|
|
+
|
|
+ value = PIL.Image.open(out0)
|
|
+ out1 = BytesIO()
|
|
+ value.save(out1, typ)
|
|
+ expected = "data:image/%s;base64," % typ + base64.b64encode(out1.getvalue()).decode('ascii')
|
|
|
|
prop = bcpv.Image()
|
|
assert prop.transform(value) == expected
|