Skip to content

Commit

Permalink
chore: Run new black formatter version
Browse files Browse the repository at this point in the history
  • Loading branch information
sondrelg committed Nov 25, 2023
1 parent f256c67 commit 8859321
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 12 deletions.
1 change: 1 addition & 0 deletions tests/test_errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains special test cases that fall outside the scope of remaining test files."""

import textwrap

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_should_warn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
The behavior of TC100 and TC200 errors should be opt-in.
"""

import os
import re
from importlib.metadata import version
Expand Down
1 change: 1 addition & 0 deletions tests/test_tc004.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
>> Move import out of type-checking block. Import is used for more than type hinting.
"""

import textwrap

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_tc005.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Sometimes auto-formatting tools for removing redundant imports (i.e. Pycharms)
will leave behind empty type-checking blocks. This just flags them as redundant.
"""

import textwrap

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_tc006.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
significant overhead in hot paths. This can be avoided by quoting the type so
that it isn't resolved at runtime.
"""

import textwrap

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_tc007.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
File tests TC007:
Type alias should be wrapped in quotes
"""

import sys
import textwrap

Expand Down
23 changes: 11 additions & 12 deletions tests/test_tc008.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
File tests TC008:
Type alias is wrapped in unnecessary quotes
"""

from __future__ import annotations

import sys
Expand Down Expand Up @@ -88,23 +89,21 @@ class X(Protocol):
]

if sys.version_info >= (3, 12):
examples.extend(
[
(
# new style type alias should never be wrapped
textwrap.dedent('''
examples.extend([
(
# new style type alias should never be wrapped
textwrap.dedent('''
if TYPE_CHECKING:
type Foo = 'str'
type Bar = 'Foo'
'''),
{
'3:15 ' + TC008.format(alias='str'),
'5:11 ' + TC008.format(alias='Foo'),
},
)
]
)
{
'3:15 ' + TC008.format(alias='str'),
'5:11 ' + TC008.format(alias='Foo'),
},
)
])


@pytest.mark.parametrize(('example', 'expected'), examples)
Expand Down
1 change: 1 addition & 0 deletions tests/test_tc009.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
>> Move declaration out of type-checking block. Variable is used for more than type hinting.
"""

import sys
import textwrap

Expand Down
1 change: 1 addition & 0 deletions tests/test_tc100.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
One thing to note: futures imports should always be at the top of a file, so we only need to check one line.
"""

import sys
import textwrap

Expand Down
1 change: 1 addition & 0 deletions tests/test_tc101.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
File tests TC101:
Annotation is wrapped in unnecessary quotes
"""

import sys
import textwrap

Expand Down
1 change: 1 addition & 0 deletions tests/test_tc200.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
File tests TC200:
Annotation should be wrapped in quotes
"""

import sys
import textwrap

Expand Down
1 change: 1 addition & 0 deletions tests/test_tc201.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
File tests TC201:
Annotation is wrapped in unnecessary quotes
"""

import sys
import textwrap

Expand Down

0 comments on commit 8859321

Please sign in to comment.