TGViewer
Находки в опенсорсе: Python Находки в опенсорсе: Python @opensource_findings_python · 1.06K subscribers
Post #322 427
🚀 New issue to wemake-services/wemake-python-styleguide by @Novohudonossor
📝 tstring_same_prefix params contain f-strings — the t-string coverage from #3702 is never exercised (#3793)


What's wrong

Two test constants touched by #3702 ("extend f-string rules to t-strings") do not exercise t-strings at all.

1. tests/test_visitors/test_ast/test_complexity/test_overuses/test_overused_string.py:112-131

tstring_same_prefix1 = pytest.param(
"""
x = f'Hello, {pattern}'
y = f'Hello, {pattern}'
""",
marks=pytest.mark.skipif(not PY314, reason='t-strings are only in Python 3.14+'),
)

The snippet is identical to fstring_same_prefix1 right above it. Below 3.14 the param is skipped by the mark; on 3.14+ it runs and asserts on f-strings. Either way WPS226 is never checked against a t-string, and the suite stays green.

2. tests/test_visitors/test_tokenize/test_comments/test_comment_in_formatted_string312.py:87

PREFIXES is ['f', 't'] and both tests run code.format(prefix), so every constant is exercised twice. rfstring_with_comment_triple_single_quotes hardcodes rf'''…''' instead of r{0}'''…''' like its two siblings above it, so the t round re-tests rf.

How it should be
1. t'Hello, {pattern}' and t'{pattern}-postfix' inside the two tstring_same_prefix* params.
2. r{0}'''test{{a # comment\n}}''', matching rfstring_with_comment_single_quotes and rfstring_with_comment_triple_quotes.

Happy to open a PR for both if that is useful.

Flake8 version and plugins / pip information / OS information

Not applicable — this is not a runtime report. Found by reading the tests, verified against HEAD 8ebc607; there is no flake8 --bug-report output to paste.

Provenance

Both came out of a review run with ReviewGate (https://reviewgate.dev), a local review gate I build, over 76b3ac3~1..c580fc3. The run was local, on my own model key, and nothing left my machine.


#bug #help_wanted #levelstarter #good_first_issue #wemake_python_styleguide #wps
sent via relator
More from @opensource_findings_python
  1. Sep 22, 2026🚀 New issue to faststream-community/zMQTT by @borisalekseev 📝 Mark flaky Artemis test xf…
  2. Sep 17, 2026Помните про https://github.com/ozeranskii/httptap? Я писал о нем давно еще - > тут. Наклеп…
  3. Sep 15, 2026🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 `test_custom_union_form…
  4. Sep 13, 2026🚀 New issue to wemake-services/django-modern-rest by @milssky 📝 Changes in benchmarking…
  5. Sep 13, 2026🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 Fix `operation_id` defa…
  6. Sep 13, 2026🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 Fix unused `security` f…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →