summaryrefslogtreecommitdiff
path: root/tests/functional/t/trailing_comma_tuple.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/t/trailing_comma_tuple.py')
-rw-r--r--tests/functional/t/trailing_comma_tuple.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/functional/t/trailing_comma_tuple.py b/tests/functional/t/trailing_comma_tuple.py
new file mode 100644
index 000000000..a832ccc28
--- /dev/null
+++ b/tests/functional/t/trailing_comma_tuple.py
@@ -0,0 +1,38 @@
+"""Check trailing comma one element tuples."""
+# pylint: disable=bad-whitespace, missing-docstring
+AAA = 1, # [trailing-comma-tuple]
+BBB = "aaaa", # [trailing-comma-tuple]
+CCC="aaa", # [trailing-comma-tuple]
+FFF=['f'], # [trailing-comma-tuple]
+
+BBB = 1, 2
+CCC = (1, 2, 3)
+DDD = (
+ 1, 2, 3,
+)
+EEE = (
+ "aaa",
+)
+
+
+def test(*args, **kwargs):
+ return args, kwargs
+
+
+test(widget=1, label='test')
+test(widget=1,
+ label='test')
+test(widget=1, \
+ label='test')
+
+
+def some_func(first, second):
+ if first:
+ return first, # [trailing-comma-tuple]
+ if second:
+ return (first, second,)
+ return first, second, # [trailing-comma-tuple]
+
+
+def some_other_func():
+ yield 'hello', # [trailing-comma-tuple]