summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional/volume
diff options
context:
space:
mode:
authorMatt Riedemann <mriedem.os@gmail.com>2019-09-18 11:58:12 -0400
committerMatt Riedemann <mriedem.os@gmail.com>2019-11-20 13:39:40 +0000
commit5b3a827a1ff80e4b51c7ede44b84bf640d5b6380 (patch)
treecd22a0cf7689b6e2c4d8981fa89f49d459d53a77 /openstackclient/tests/functional/volume
parent874a726f522dae3a08832f32230e2590a787d45c (diff)
downloadpython-openstackclient-5b3a827a1ff80e4b51c7ede44b84bf640d5b6380.tar.gz
Provide stderr in exception when check_parser fails
For negative tests that are asserting an argparse failure it would be useful to assert the specific reason for the failure in the test rather than just getting an exception, especially to avoid false positives in the tests when what is being tested and failing isn't the actual expected reason for the failure. This wraps the check_parser code that parses the args and mocks sys.stderr so we can trap that output and put it in the exception message that gets raised to the test. As a result, we can tighten up a test that was passing before for the wrong reason [1]. [1] https://review.opendev.org/#/c/673725/12/openstackclient/tests/unit/compute/v2/test_server.py@605 Change-Id: I0f1dc1215bdfb3eba98ccaf66a0041d220b93812
Diffstat (limited to 'openstackclient/tests/functional/volume')
0 files changed, 0 insertions, 0 deletions