summaryrefslogtreecommitdiff
path: root/tests/test_util.py
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2015-12-10 21:27:20 +0200
committerAlex Grönholm <alex.gronholm@nextday.fi>2015-12-10 22:53:17 +0200
commit91df56944c6c160729ba213484794d963bbce62e (patch)
tree6842e97b2a614ad939e1f1a0279b8fdcf0099074 /tests/test_util.py
parent1652c1b68b932ddc21b47e562f6ff04d2d2268b8 (diff)
downloadapscheduler-91df56944c6c160729ba213484794d963bbce62e.tar.gz
Made "funcsigs" a mandatory dependency on Python 2
Diffstat (limited to 'tests/test_util.py')
-rw-r--r--tests/test_util.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/test_util.py b/tests/test_util.py
index 066ad2a..1164c49 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -233,37 +233,32 @@ def test_repr_escape_py2(input, expected):
class TestCheckCallableArgs(object):
- @pytest.fixture(params=[True, False], ids=['signature', 'getargspec'])
- def use_signature(self, request, monkeypatch):
- if not request.param:
- monkeypatch.setattr('apscheduler.util.signature', None)
-
- def test_invalid_callable_args(self, use_signature):
+ def test_invalid_callable_args(self):
"""Tests that attempting to create a job with an invalid number of arguments raises an exception."""
exc = pytest.raises(ValueError, check_callable_args, lambda x: None, [1, 2], {})
assert str(exc.value) == ('The list of positional arguments is longer than the target callable can handle '
'(allowed: 1, given in args: 2)')
- def test_invalid_callable_kwargs(self, use_signature):
+ def test_invalid_callable_kwargs(self):
"""Tests that attempting to schedule a job with unmatched keyword arguments raises an exception."""
exc = pytest.raises(ValueError, check_callable_args, lambda x: None, [], {'x': 0, 'y': 1})
assert str(exc.value) == 'The target callable does not accept the following keyword arguments: y'
- def test_missing_callable_args(self, use_signature):
+ def test_missing_callable_args(self):
"""Tests that attempting to schedule a job with missing arguments raises an exception."""
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):
+ def test_default_args(self):
"""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):
+ def test_conflicting_callable_args(self):
"""
Tests that attempting to schedule a job where the combination of args and kwargs are in conflict raises an
exception.