Fix no named args bug (close #25)

This commit is contained in:
David Wolever
2015-06-18 13:22:23 -04:00
parent 5db460121e
commit ce6d611381
4 changed files with 9 additions and 2 deletions

View File

@@ -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)

View File

@@ -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:]

View File

@@ -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, ))]),

View File

@@ -9,7 +9,7 @@ os.chdir(os.path.dirname(sys.argv[0]) or ".")
setup(
name="nose-parameterized",
version="0.4.1",
version="0.4.2",
url="https://github.com/wolever/nose-parameterized",
author="David Wolever",
author_email="david@wolever.net",