diff options
author | Rodolfo Carvalho <rhcarvalho@gmail.com> | 2017-02-27 22:11:13 +0100 |
---|---|---|
committer | Rodolfo Carvalho <rhcarvalho@gmail.com> | 2017-03-06 13:41:08 +0100 |
commit | 2e0aa00fe7d4a82c0267191deee1b7613787ab9d (patch) | |
tree | 2ab15326f85b620d6894acd388f5dceefb96f40f /utils/test/fixture.py | |
parent | ca3cf657bf4b6676166579065926bf315a73e416 (diff) | |
download | openshift-2e0aa00fe7d4a82c0267191deee1b7613787ab9d.tar.gz openshift-2e0aa00fe7d4a82c0267191deee1b7613787ab9d.tar.bz2 openshift-2e0aa00fe7d4a82c0267191deee1b7613787ab9d.tar.xz openshift-2e0aa00fe7d4a82c0267191deee1b7613787ab9d.zip |
Lint utils/test
- Do not use `print` in unit tests, send messages through the test
framework instead.
- Remove unused import.
- Add spaces around equal sign in assigment.
- Turn method into a function.
- Reorganize imports according to PEP8.
Diffstat (limited to 'utils/test/fixture.py')
-rw-r--r-- | utils/test/fixture.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/utils/test/fixture.py b/utils/test/fixture.py index 5200d275d..873ac4a27 100644 --- a/utils/test/fixture.py +++ b/utils/test/fixture.py @@ -65,14 +65,13 @@ class OOCliFixture(OOInstallFixture): def assert_result(self, result, exit_code): if result.exit_code != exit_code: - print("Unexpected result from CLI execution") - print("Exit code: %s" % result.exit_code) - print("Exception: %s" % result.exception) - print(result.exc_info) + msg = ["Unexpected result from CLI execution\n"] + msg.append("Exit code: %s\n" % result.exit_code) + msg.append("Exception: %s\n" % result.exception) import traceback - traceback.print_exception(*result.exc_info) - print("Output:\n%s" % result.output) - self.fail("Exception during CLI execution") + msg.extend(traceback.format_exception(*result.exc_info)) + msg.append("Output:\n%s" % result.output) + self.fail("".join(msg)) def _verify_load_facts(self, load_facts_mock): """ Check that we ran load facts with expected inputs. """ |