diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2023-02-12 22:37:34 +0100 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2023-02-13 09:34:08 +0100 |
commit | 0a4027655c9fbf64470f9d83e9f0ee52e5dcdda7 (patch) | |
tree | ffea48b4018a10a59f058d95d024db6bc49adc6c /tests | |
parent | fadd9dc4a8f9b7f69cea8b55fb4a317a3d97b725 (diff) | |
download | pylint-git-0a4027655c9fbf64470f9d83e9f0ee52e5dcdda7.tar.gz |
Add regression test for #8109
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/r/regression_02/regression_8109.py | 15 | ||||
-rw-r--r-- | tests/functional/r/regression_02/regression_8109.txt | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/functional/r/regression_02/regression_8109.py b/tests/functional/r/regression_02/regression_8109.py new file mode 100644 index 000000000..f5cf8b142 --- /dev/null +++ b/tests/functional/r/regression_02/regression_8109.py @@ -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(".") diff --git a/tests/functional/r/regression_02/regression_8109.txt b/tests/functional/r/regression_02/regression_8109.txt new file mode 100644 index 000000000..161925b7d --- /dev/null +++ b/tests/functional/r/regression_02/regression_8109.txt @@ -0,0 +1 @@ +consider-using-f-string:14:24:14:34:Number.__str__:Formatting a regular string which could be a f-string:UNDEFINED |