summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2015-01-06 17:43:02 +0200
committerAlex Grönholm <alex.gronholm@nextday.fi>2015-01-06 17:46:04 +0200
commite1555923725601b92abd7219728c01e6179dbf86 (patch)
tree4bd3d4cdfe47364e24e6165f3f88ef420919d330 /tests
parente6298f953a68ccf536277a63ab9630a3293bec48 (diff)
downloadapscheduler-e1555923725601b92abd7219728c01e6179dbf86.tar.gz
Fixed ValueError when the target callable has a default keyword argument that wasn't overridden
Diffstat (limited to 'tests')
-rw-r--r--tests/test_util.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_util.py b/tests/test_util.py
index a416297..6908bc3 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -257,6 +257,12 @@ class TestCheckCallableArgs(object):
exc = pytest.raises(ValueError, check_callable_args, lambda x, y, z: None, [1], {'y': 0})
assert str(exc.value) == 'The following arguments have not been supplied: z'
+ def test_default_args(self, use_signature):
+ """Tests that default values for arguments are properly taken into account."""
+
+ exc = pytest.raises(ValueError, check_callable_args, lambda x, y, z=1: None, [1], {})
+ assert str(exc.value) == 'The following arguments have not been supplied: y'
+
def test_conflicting_callable_args(self, use_signature):
"""
Tests that attempting to schedule a job where the combination of args and kwargs are in conflict raises an