diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2020-05-12 14:09:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-12 14:09:40 -0400 |
commit | c8f20b31cd57443b1bef17579dfceca432420c94 (patch) | |
tree | 15801b7d0d08dc130c4e71024ad4481b32aa63e8 /cloudinit/conftest.py | |
parent | d10ce3ecfe89d7ec2a69bdbd109b100090698ded (diff) | |
download | vyos-cloud-init-c8f20b31cd57443b1bef17579dfceca432420c94.tar.gz vyos-cloud-init-c8f20b31cd57443b1bef17579dfceca432420c94.zip |
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 "<stdin>", line 1, in <module>
TypeError: subp() missing 1 required positional argument: 'args'
Diffstat (limited to 'cloudinit/conftest.py')
-rw-r--r-- | cloudinit/conftest.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cloudinit/conftest.py b/cloudinit/conftest.py index 6a1c63e9..af458c31 100644 --- a/cloudinit/conftest.py +++ b/cloudinit/conftest.py @@ -21,7 +21,9 @@ def disable_subp_usage(request): util.subp(["whoami"]) This fixture (roughly) mirrors the functionality of - CiTestCase.allowed_subp. + CiTestCase.allowed_subp. N.B. While autouse fixtures do affect non-pytest + tests, CiTestCase's allowed_subp does take precedence (and we have + TestDisableSubpUsageInTestSubclass to confirm that). TODO: * Enable select subp usage (i.e. allowed_subp=[...]) |