From 06d6ed98cef1514b40fb95baeab669eff814191d Mon Sep 17 00:00:00 2001 From: Cheng Huzi Date: Thu, 1 Jul 2021 01:14:25 -0400 Subject: [PATCH] Fix type annotation error --- tests/test_api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index 39763689..bfb27398 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -26,7 +26,7 @@ class APITestCase(TestCase): self.assertEqual(len(study_summaries), 2) def test_get_study_details(self) -> None: - def objective(trial): + def objective(trial: optuna.trial.Trial) -> float: x = trial.suggest_float("x", -1, 1) return x @@ -51,7 +51,7 @@ class APITestCase(TestCase): app, f"/api/studies/{study_id}", "GET", - queries={"before": 5}, + queries={"before": "5"}, content_type="application/json", ) self.assertEqual(status, 200) @@ -62,7 +62,7 @@ class APITestCase(TestCase): app, f"/api/studies/{study_id}", "GET", - queries={"before": 10}, + queries={"before": "10"}, content_type="application/json", ) self.assertEqual(status, 200) @@ -73,7 +73,7 @@ class APITestCase(TestCase): app, f"/api/studies/{study_id}", "GET", - queries={"before": -1}, + queries={"before": "-1"}, content_type="application/json", ) self.assertEqual(status, 400)