From c8f20b31cd57443b1bef17579dfceca432420c94 Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Tue, 12 May 2020 14:09:40 -0400 Subject: conftest: add docs and tests regarding CiTestCase's subp functionality (#343) And raise TypeError when subp called with no args, which more accurately mirrors normal behaviour: >>> from cloudinit.util import subp >>> subp() Traceback (most recent call last): File "", line 1, in TypeError: subp() missing 1 required positional argument: 'args' --- cloudinit/tests/helpers.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cloudinit/tests/helpers.py') diff --git a/cloudinit/tests/helpers.py b/cloudinit/tests/helpers.py index 477e14c2..b0af54c1 100644 --- a/cloudinit/tests/helpers.py +++ b/cloudinit/tests/helpers.py @@ -144,6 +144,9 @@ class CiTestCase(TestCase): if 'args' in kwargs: cmd = kwargs['args'] else: + if not args: + raise TypeError( + "subp() missing 1 required positional argument: 'args'") cmd = args[0] if not isinstance(cmd, str): -- cgit v1.2.3