Skip to content

Commit

Permalink
check fstring_positions_work rather than python version
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmojaki committed Sep 30, 2023
1 parent 7518004 commit c637c2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import sys
from contextlib import contextmanager

import pytest
import pygments
import pytest
from asttokens.util import fstring_positions_work

from stack_data import Formatter, FrameInfo, Options, BlankLines
from tests.utils import compare_to_file
Expand Down Expand Up @@ -82,8 +83,7 @@ def check_example(name):

if sys.version_info[:2] < (3, 8):
f_string_suffix = 'old'
elif sys.version_info[:2] == (3, 8):
# lineno/col_offset in f-strings cannot be trusted in 3.8
elif not fstring_positions_work():
f_string_suffix = '3.8'
else:
f_string_suffix = 'new'
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ commands = pytest {posargs}
extras = tests
passenv =
STACK_DATA_SLOW_TESTS
FIX_STACK_DATA_TESTS

0 comments on commit c637c2a

Please sign in to comment.