summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_keywordonlyarg.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_keywordonlyarg.py')
-rw-r--r--Lib/test/test_keywordonlyarg.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_keywordonlyarg.py b/Lib/test/test_keywordonlyarg.py
index 0503a7f..7aabdfc 100644
--- a/Lib/test/test_keywordonlyarg.py
+++ b/Lib/test/test_keywordonlyarg.py
@@ -176,6 +176,14 @@ class KeywordOnlyArgTestCase(unittest.TestCase):
return __a
self.assertEqual(X().f(), 42)
+ def test_default_evaluation_order(self):
+ # See issue 16967
+ a = 42
+ with self.assertRaises(NameError) as err:
+ def f(v=a, x=b, *, y=c, z=d):
+ pass
+ self.assertEqual(str(err.exception), "global name 'b' is not defined")
+
def test_main():
run_unittest(KeywordOnlyArgTestCase)