Fix regression caused by changing the signature for parse_known_args

Fix #973
This commit is contained in:
Bruno Oliveira
2015-08-27 19:35:32 -03:00
parent 06b1b69fb7
commit 4533a50542
2 changed files with 21 additions and 7 deletions
+9 -2
View File
@@ -105,10 +105,17 @@ class TestParser:
def test_parse_known_args(self, parser):
parser.parse_known_args([py.path.local()])
parser.addoption("--hello", action="store_true")
ns, extra_args = parser.parse_known_args(["x", "--y", "--hello", "this"])
ns = parser.parse_known_args(["x", "--y", "--hello", "this"])
assert ns.hello
assert ns.file_or_dir == ['x']
assert extra_args == ['--y', 'this']
def test_parse_known_and_unknown_args(self, parser):
parser.addoption("--hello", action="store_true")
ns, unknown = parser.parse_known_and_unknown_args(["x", "--y",
"--hello", "this"])
assert ns.hello
assert ns.file_or_dir == ['x']
assert unknown == ['--y', 'this']
def test_parse_will_set_default(self, parser):
parser.addoption("--hello", dest="hello", default="x", action="store")