From 8ee0af627387813255f9f39d75fae1f32b45f470 Mon Sep 17 00:00:00 2001 From: space-nuko <24979496+space-nuko@users.noreply.github.com> Date: Thu, 16 Mar 2023 23:14:43 -0400 Subject: [PATCH] Fix tests on Windows --- gradio/components.py | 1 + pytest.ini | 3 +++ test/test_routes.py | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 pytest.ini diff --git a/gradio/components.py b/gradio/components.py index 88d26704659b5..b36c0aa628e67 100644 --- a/gradio/components.py +++ b/gradio/components.py @@ -1790,6 +1790,7 @@ def _segment_by_slic(self, x): compactness=10, sigma=1, start_label=1, + channel_axis=None ) except TypeError: # For skimage 0.16 and older segments_slic = slic( diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000000000..22c84a15fd029 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +minversion = 3.7 +testpaths = test diff --git a/test/test_routes.py b/test/test_routes.py index 374a48fe3a902..62ed986134b5c 100644 --- a/test/test_routes.py +++ b/test/test_routes.py @@ -56,7 +56,7 @@ def test_get_config_route(self, test_client): def test_upload_route(self, test_client): response = test_client.post( - "/upload", files={"files": open("test/test_files/alphabet.txt", "r")} + "/upload", files={"files": open("test/test_files/alphabet.txt", "rb")} ) assert response.status_code == 200 file = response.json()[0]