Fix no named args bug (close #25)
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
0.4.2 (2015-05-18)
|
||||
* Fix bug with expand + empty arguments (thanks @jikamens;
|
||||
https://github.com/wolever/nose-parameterized/pull/25)
|
||||
|
||||
0.4.1 (2015-05-17)
|
||||
* Fix bug with expand + empty docstring (thanks @jikamens;
|
||||
https://github.com/wolever/nose-parameterized/pull/24)
|
||||
|
||||
@@ -132,7 +132,7 @@ def parameterized_argument_value_pairs(func, p):
|
||||
[("foo", 1), ("*args", (16, ))]
|
||||
"""
|
||||
argspec = inspect.getargspec(func)
|
||||
arg_offset = 1 if argspec.args[0] == "self" else 0
|
||||
arg_offset = 1 if argspec.args[:1] == ["self"] else 0
|
||||
|
||||
named_args = argspec.args[arg_offset:]
|
||||
|
||||
|
||||
@@ -184,6 +184,9 @@ class TestOldStyleClass:
|
||||
|
||||
|
||||
@parameterized([
|
||||
("", param(), []),
|
||||
("*a, **kw", param(), []),
|
||||
("*a, **kw", param(1, foo=42), [("*a", (1, )), ("**kw", {"foo": 42})]),
|
||||
("foo", param(1), [("foo", 1)]),
|
||||
("foo, *a", param(1), [("foo", 1)]),
|
||||
("foo, *a", param(1, 9), [("foo", 1), ("*a", (9, ))]),
|
||||
|
||||
Reference in New Issue
Block a user