summaryrefslogtreecommitdiff
path: root/tests/functional/r/regression_02/regression_8109.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/r/regression_02/regression_8109.py')
-rw-r--r--tests/functional/r/regression_02/regression_8109.py15
1 files changed, 15 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(".")