Align continuations in tests
This commit is contained in:
parent
ff49655c47
commit
a15575f78a
|
@ -11,7 +11,6 @@ builtins = basestring, unicode
|
|||
max-line-length = 90
|
||||
ignore =
|
||||
# temporary ignores until we sort it out
|
||||
E128,
|
||||
E306,
|
||||
E701,
|
||||
E704,
|
||||
|
|
|
@ -581,8 +581,10 @@ class GenericTests(BaseTestCase):
|
|||
self.assertEqual(repr(typing.Mapping[T, TS][TS, T]), 'typing.Mapping[~TS, ~T]')
|
||||
self.assertEqual(repr(List[Tuple[T, TS]][int, T]),
|
||||
'typing.List[typing.Tuple[int, ~T]]')
|
||||
self.assertEqual(repr(List[Tuple[T, T]][List[int]]),
|
||||
'typing.List[typing.Tuple[typing.List[int], typing.List[int]]]')
|
||||
self.assertEqual(
|
||||
repr(List[Tuple[T, T]][List[int]]),
|
||||
'typing.List[typing.Tuple[typing.List[int], typing.List[int]]]'
|
||||
)
|
||||
|
||||
def test_new_repr_bare(self):
|
||||
T = TypeVar('T')
|
||||
|
@ -653,8 +655,10 @@ class GenericTests(BaseTestCase):
|
|||
raise NotImplementedError
|
||||
if tp.__args__:
|
||||
KT, VT = tp.__args__
|
||||
return all(isinstance(k, KT) and isinstance(v, VT)
|
||||
for k, v in obj.items())
|
||||
return all(
|
||||
isinstance(k, KT) and isinstance(v, VT)
|
||||
for k, v in obj.items()
|
||||
)
|
||||
self.assertTrue(naive_dict_check({'x': 1}, typing.Dict[typing.Text, int]))
|
||||
self.assertFalse(naive_dict_check({1: 'x'}, typing.Dict[typing.Text, int]))
|
||||
with self.assertRaises(NotImplementedError):
|
||||
|
|
|
@ -612,8 +612,10 @@ class GenericTests(BaseTestCase):
|
|||
self.assertEqual(repr(typing.Mapping[T, TS][TS, T]), 'typing.Mapping[~TS, ~T]')
|
||||
self.assertEqual(repr(List[Tuple[T, TS]][int, T]),
|
||||
'typing.List[typing.Tuple[int, ~T]]')
|
||||
self.assertEqual(repr(List[Tuple[T, T]][List[int]]),
|
||||
'typing.List[typing.Tuple[typing.List[int], typing.List[int]]]')
|
||||
self.assertEqual(
|
||||
repr(List[Tuple[T, T]][List[int]]),
|
||||
'typing.List[typing.Tuple[typing.List[int], typing.List[int]]]'
|
||||
)
|
||||
|
||||
def test_new_repr_bare(self):
|
||||
T = TypeVar('T')
|
||||
|
@ -684,8 +686,10 @@ class GenericTests(BaseTestCase):
|
|||
raise NotImplementedError
|
||||
if tp.__args__:
|
||||
KT, VT = tp.__args__
|
||||
return all(isinstance(k, KT) and isinstance(v, VT)
|
||||
for k, v in obj.items())
|
||||
return all(
|
||||
isinstance(k, KT) and isinstance(v, VT)
|
||||
for k, v in obj.items()
|
||||
)
|
||||
self.assertTrue(naive_dict_check({'x': 1}, typing.Dict[str, int]))
|
||||
self.assertFalse(naive_dict_check({1: 'x'}, typing.Dict[str, int]))
|
||||
with self.assertRaises(NotImplementedError):
|
||||
|
@ -1750,7 +1754,7 @@ class CollectionsAbcTests(BaseTestCase):
|
|||
def test_async_generator(self):
|
||||
ns = {}
|
||||
exec("async def f():\n"
|
||||
" yield 42\n", globals(), ns)
|
||||
" yield 42\n", globals(), ns)
|
||||
g = ns['f']()
|
||||
self.assertIsSubclass(type(g), typing.AsyncGenerator)
|
||||
|
||||
|
|
2
tox.ini
2
tox.ini
|
@ -13,11 +13,11 @@ changedir = python2
|
|||
builtins = basestring, unicode
|
||||
max-line-length = 90
|
||||
ignore =
|
||||
# temporary ignores until we sort it out
|
||||
# irrelevant plugins
|
||||
B3,
|
||||
DW12
|
||||
exclude =
|
||||
# tests have more relaxed formatting rules
|
||||
# and its own specific config in .flake8-tests
|
||||
python2/test_typing.py,
|
||||
src/test_typing.py
|
||||
|
|
Loading…
Reference in New Issue