aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/traitlets/py3/tests/test_traitlets.py
diff options
context:
space:
mode:
authorarmenqa <armenqa@yandex-team.com>2024-01-19 12:23:50 +0300
committerarmenqa <armenqa@yandex-team.com>2024-01-19 13:10:03 +0300
commit2de0149d0151c514b22bca0760b95b26c9b0b578 (patch)
tree2bfed9f3bce7e643ddf048bb61ce3dc0a714bcc2 /contrib/python/traitlets/py3/tests/test_traitlets.py
parenta8c06d218f12b2406fbce24d194885c5d7b68503 (diff)
downloadydb-2de0149d0151c514b22bca0760b95b26c9b0b578.tar.gz
feat contrib: aiogram 3
Relates: https://st.yandex-team.ru/, https://st.yandex-team.ru/
Diffstat (limited to 'contrib/python/traitlets/py3/tests/test_traitlets.py')
-rw-r--r--contrib/python/traitlets/py3/tests/test_traitlets.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/contrib/python/traitlets/py3/tests/test_traitlets.py b/contrib/python/traitlets/py3/tests/test_traitlets.py
index 07c95ca251..dfcf3f0f4b 100644
--- a/contrib/python/traitlets/py3/tests/test_traitlets.py
+++ b/contrib/python/traitlets/py3/tests/test_traitlets.py
@@ -5,6 +5,7 @@
#
# Adapted from enthought.traits, Copyright (c) Enthought, Inc.,
# also under the terms of the Modified BSD License.
+from __future__ import annotations
import pickle
import re
@@ -1254,7 +1255,7 @@ class TraitTestBase(TestCase):
try:
self.assertRaises(TraitError, self.assign, value)
except AssertionError:
- assert False, value
+ assert False, value # noqa: PT015
def test_default_value(self):
if hasattr(self, "_default_value"):
@@ -1784,7 +1785,7 @@ class TestMultiTuple(TraitTestBase):
@pytest.mark.parametrize(
"Trait",
- (
+ ( # noqa: PT007
List,
Tuple,
Set,
@@ -1808,7 +1809,7 @@ def test_allow_none_default_value(Trait):
@pytest.mark.parametrize(
"Trait, default_value",
- ((List, []), (Tuple, ()), (Set, set()), (Dict, {}), (Integer, 0), (Unicode, "")),
+ ((List, []), (Tuple, ()), (Set, set()), (Dict, {}), (Integer, 0), (Unicode, "")), # noqa: PT007
)
def test_default_value(Trait, default_value):
class C(HasTraits):
@@ -1822,7 +1823,7 @@ def test_default_value(Trait, default_value):
@pytest.mark.parametrize(
"Trait, default_value",
- ((List, []), (Tuple, ()), (Set, set())),
+ ((List, []), (Tuple, ()), (Set, set())), # noqa: PT007
)
def test_subclass_default_value(Trait, default_value):
"""Test deprecated default_value=None behavior for Container subclass traits"""
@@ -2150,7 +2151,7 @@ class TestLink(TestCase):
self.i = change.new * 2
mc = MyClass()
- l = link((mc, "i"), (mc, "j")) # noqa
+ l = link((mc, "i"), (mc, "j")) # noqa: E741
self.assertRaises(TraitError, setattr, mc, "i", 2)
def test_link_broken_at_target(self):
@@ -2163,7 +2164,7 @@ class TestLink(TestCase):
self.j = change.new * 2
mc = MyClass()
- l = link((mc, "i"), (mc, "j")) # noqa
+ l = link((mc, "i"), (mc, "j")) # noqa: E741
self.assertRaises(TraitError, setattr, mc, "j", 2)
@@ -2393,7 +2394,7 @@ class OrderTraits(HasTraits):
i = Unicode()
j = Unicode()
k = Unicode()
- l = Unicode() # noqa
+ l = Unicode() # noqa: E741
def _notify(self, name, old, new):
"""check the value of all traits when each trait change is triggered
@@ -2819,7 +2820,7 @@ def test_default_mro():
def test_cls_self_argument():
class X(HasTraits):
- def __init__(__self, cls, self): # noqa
+ def __init__(__self, cls, self):
pass
x = X(cls=None, self=None)
@@ -2889,7 +2890,7 @@ def _from_string_test(traittype, s, expected):
else:
cast = trait.from_string
if type(expected) is type and issubclass(expected, Exception):
- with pytest.raises(expected):
+ with pytest.raises(expected): # noqa: PT012
value = cast(s)
trait.validate(CrossValidationStub(), value) # type:ignore
else: