Przeglądaj źródła

try to fix pytests

Falko Schindler 1 rok temu
rodzic
commit
8fdb504673
2 zmienionych plików z 8 dodań i 3 usunięć
  1. 3 1
      nicegui/observables.py
  2. 5 2
      tests/test_observables.py

+ 3 - 1
nicegui/observables.py

@@ -1,4 +1,6 @@
-from typing import Any, Callable, Dict, Iterable, List, Set, SupportsIndex, Union, overload
+from typing import Any, Callable, Dict, Iterable, List, Set, Union, overload
+
+from typing_extensions import SupportsIndex
 
 
 
 
 class ObservableDict(dict):
 class ObservableDict(dict):

+ 5 - 2
tests/test_observables.py

@@ -1,3 +1,5 @@
+import sys
+
 from nicegui.observables import make_observable
 from nicegui.observables import make_observable
 
 
 count = 0
 count = 0
@@ -30,8 +32,9 @@ def test_observable_dict():
     assert count == 6
     assert count == 6
     data.setdefault('a', 1)
     data.setdefault('a', 1)
     assert count == 7
     assert count == 7
-    data |= {'b': 2}
-    assert count == 8
+    if sys.version_info >= (3, 9):
+        data |= {'b': 2}
+        assert count == 8
 
 
 
 
 def test_observable_list():
 def test_observable_list():