mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-08-20 12:40:54 +08:00
Update type annotations in python_tests
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import base64
|
||||
import json
|
||||
import tempfile
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import io
|
||||
import uuid
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import io
|
||||
from unittest import TestCase
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import io
|
||||
import tempfile
|
||||
from unittest import TestCase
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import io
|
||||
import uuid
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from unittest.mock import patch
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import itertools
|
||||
from typing import Sequence
|
||||
from typing import Union
|
||||
|
||||
import optuna
|
||||
from optuna_dashboard import ChoiceWidget
|
||||
@@ -60,7 +61,7 @@ for r in range(len(widget_list) + 1):
|
||||
|
||||
@pytest.mark.parametrize("widgets", widgets_combinations_for_user_attr)
|
||||
def test_render_user_attr_form_widgets(
|
||||
widgets: Sequence[Union[ChoiceWidget, SliderWidget, TextInputWidget]],
|
||||
widgets: Sequence[ChoiceWidget | SliderWidget | TextInputWidget],
|
||||
) -> None:
|
||||
study = optuna.create_study()
|
||||
register_user_attr_form_widgets(study, widgets) # type: ignore
|
||||
@@ -77,7 +78,7 @@ for r in range(1, len(widget_list) + 1):
|
||||
|
||||
@pytest.mark.parametrize("widgets", widgets_combinations_for_objective)
|
||||
def test_render_objective_form_widgets(
|
||||
widgets: Sequence[Union[ChoiceWidget, SliderWidget, TextInputWidget]],
|
||||
widgets: Sequence[ChoiceWidget | SliderWidget | TextInputWidget],
|
||||
) -> None:
|
||||
study = optuna.create_study(directions=["maximize"] * len(widgets))
|
||||
register_objective_form_widgets(study, widgets) # type: ignore
|
||||
|
||||
@@ -2,8 +2,6 @@ from __future__ import annotations
|
||||
|
||||
import io
|
||||
import typing
|
||||
from typing import Optional
|
||||
from typing import Union
|
||||
|
||||
from bottle import Bottle
|
||||
from optuna_dashboard._storage import trials_cache
|
||||
@@ -58,9 +56,9 @@ def send_request(
|
||||
app: Bottle,
|
||||
path: str,
|
||||
method: str,
|
||||
body: Union[str, bytes] = b"",
|
||||
queries: Optional[dict[str, str]] = None,
|
||||
headers: Optional[dict[str, str]] = None,
|
||||
body: str | bytes = b"",
|
||||
queries: dict[str, str] | None = None,
|
||||
headers: dict[str, str] | None = None,
|
||||
content_type: str = "text/plain; charset=utf-8",
|
||||
) -> tuple[int, list[tuple[str, str]], bytes]:
|
||||
status: str = ""
|
||||
|
||||
Reference in New Issue
Block a user