Skip to content

Commit

Permalink
Add regression test for #8109
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Feb 13, 2023
1 parent fadd9dc commit 0a40276
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/functional/r/regression_02/regression_8109.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Regression test for https://github.com/PyCQA/pylint/issues/8109."""

# pylint: disable=missing-docstring, unsupported-binary-operation

from dataclasses import dataclass


@dataclass
class Number:
amount: int | float
round: int = 2

def __str__(self):
number_format = "{:,.%sf}" % self.round # [consider-using-f-string]
return number_format.format(self.amount).rstrip("0").rstrip(".")
1 change: 1 addition & 0 deletions tests/functional/r/regression_02/regression_8109.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
consider-using-f-string:14:24:14:34:Number.__str__:Formatting a regular string which could be a f-string:UNDEFINED

0 comments on commit 0a40276

Please sign in to comment.