Skip to content

Commit ad1d19c

Browse files
committed
Fix all lints, etc.
1 parent 53a71aa commit ad1d19c

File tree

12 files changed

+23
-19
lines changed

12 files changed

+23
-19
lines changed

pep/afstring.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"""
66

77
import inspect
8-
98
from string.templatelib import Interpolation, Template
109

1110
from .fstring import convert

pep/format.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55

66
import re
77
import string
8-
from typing import Literal
9-
108
from string.templatelib import Interpolation, Template
9+
from typing import Literal
1110

1211

1312
def _split_field_name(field_name: str) -> tuple[str, str]:

pep/fstring.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
See also `test_fstring.py`
1010
"""
1111

12-
from typing import Literal
13-
1412
from string.templatelib import Interpolation, Template
13+
from typing import Literal
1514

1615

1716
def convert(value: object, conversion: Literal["a", "r", "s"] | None) -> object:

pep/logging.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88

99
from json import JSONEncoder
1010
from logging import Formatter, LogRecord
11-
from typing import Any, Literal, Mapping, Protocol
12-
1311
from string.templatelib import Interpolation, Template
12+
from typing import Any, Literal, Mapping, Protocol
1413

1514
from .fstring import f
1615

pep/test.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"""
77

88
import asyncio
9+
from string.templatelib import Interpolation, Template
910

1011
import pytest
11-
from string.templatelib import Interpolation, Template
1212

1313
from . import (
1414
__BUG_INTERPOLATION_CONSTRUCTOR_IGNORE_CONV,
@@ -30,7 +30,9 @@
3030
def test_empty():
3131
template = t""
3232
assert isinstance(template, Template)
33-
assert template.strings == ("",) # This will fail if interleaving is not implemented
33+
assert template.strings == (
34+
"",
35+
) # This will fail if interleaving is not implemented
3436
assert template.interpolations == ()
3537
assert list(template) == []
3638

@@ -469,6 +471,7 @@ def test_template_raw_template_strings_1():
469471
assert len(template.interpolations) == 1
470472
assert template.interpolations[0].value == trade
471473

474+
472475
@pytest.mark.skipif(
473476
_INCORRECT_SYNTAX_ERROR_MESSAGE,
474477
reason="Template syntax error message not implemented",
@@ -576,6 +579,7 @@ def test_template_constructor_with_only_interpolations():
576579
assert template.interpolations[0] is x
577580
assert template.interpolations[1] is y
578581

582+
579583
@pytest.mark.skipif(
580584
_BUG_TEMPLATE_CONSTRUCTOR, reason="Template constructor not fully implemented"
581585
)

pep/test_afstring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
2+
from string.templatelib import Template
23

34
import pytest
4-
from string.templatelib import Template
55

66
from .afstring import async_f
77
from .fstring import f

pep/test_format.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import pytest
21
from string.templatelib import Interpolation, Template
32

3+
import pytest
4+
45
from .format import _split_field_name, from_format
56

67

@@ -60,7 +61,11 @@ def _interpolation_almost_eq(i1: Interpolation, i2: Interpolation) -> bool:
6061
value, conversion, and format_spec fields. The expr field is not used
6162
in the comparison.
6263
"""
63-
return (i1.value, i1.conversion, i1.format_spec) == (i2.value, i2.conversion, i2.format_spec)
64+
return (i1.value, i1.conversion, i1.format_spec) == (
65+
i2.value,
66+
i2.conversion,
67+
i2.format_spec,
68+
)
6469

6570

6671
def _almost_eq(t1: Template, t2: Template) -> bool:
@@ -87,7 +92,6 @@ def _almost_eq(t1: Template, t2: Template) -> bool:
8792
return True
8893

8994

90-
9195
def test_from_format_empty():
9296
made: Template = from_format("")
9397
expected: Template = t""

pep/test_fstring.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
Test our 'implementation' of f-string behavior as seen in PEP 750.
33
"""
44

5-
import pytest
65
from string.templatelib import Template
76

7+
import pytest
8+
89
from . import (
910
_BUG_CONSTANT_TEMPLATE,
1011
_BUG_INTERPOLATION_MATCH_ARGS,

pep/test_logging.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import logging
33
from decimal import Decimal
44
from json import JSONEncoder
5-
65
from string.templatelib import Template
76

87
from .logging import (

pep/test_reuse.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import pytest
21
from string.templatelib import Template
32

3+
import pytest
4+
45
from .reuse import Binder, Formatter
56

67

0 commit comments

Comments
 (0)