summaryrefslogtreecommitdiffstats
path: root/support/testing/tests/package/sample_python_attrs.py
diff options
context:
space:
mode:
Diffstat (limited to 'support/testing/tests/package/sample_python_attrs.py')
-rw-r--r--support/testing/tests/package/sample_python_attrs.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/support/testing/tests/package/sample_python_attrs.py b/support/testing/tests/package/sample_python_attrs.py
new file mode 100644
index 0000000000..f224944914
--- /dev/null
+++ b/support/testing/tests/package/sample_python_attrs.py
@@ -0,0 +1,15 @@
+import attr
+
+
+@attr.s
+class Obj(object):
+ x = attr.ib()
+ y = attr.ib(default=1)
+
+
+obj1 = Obj(2)
+assert(obj1.x == 2)
+assert(obj1.y == 1)
+obj2 = Obj(3, 4)
+assert(obj2.x == 3)
+assert(obj2.y == 4)
OpenPOWER on IntegriCloud