Hello Attila Bukor, Kudu Jenkins,

I'd like you to do a code review. Please visit

    http://gerrit.cloudera.org:8080/19981

to review the following change.


Change subject: [Python] Refactor tests to use assertRaisesRegex
......................................................................

[Python] Refactor tests to use assertRaisesRegex

The Python unittest.TestCase class offers the assertRaises() and
assertRaisesRegex() functions to test that an exception is raised when
callable is called [1].

Currently assertRaises(exception) is used in the Python
client tests, to assert the type of a given error. This patch refactors
usages of assertRaises() to assertRaisesRegex(exception, regex) in order
to assert the error message as well.

In Python3.2 assertRaisesRegexp has been renamed to assertRaisesRegex
(without the trailing 'p') [2].  To be able to use assertRaisesRegex
throughout the Python codebase, a compatibility class called
CompatUnitTest is added.

[1] https://docs.python.org/3/library/unittest.html#unittest.TestCase
[2] https://docs.python.org/3.9/library/unittest.html
    #unittest.TestCase.assertRaisesRegex

Change-Id: I41e2d69996ee0ed0f0418ae184d95239f2739efb
Reviewed-on: http://gerrit.cloudera.org:8080/19633
Tested-by: Kudu Jenkins
Reviewed-by: Attila Bukor <abu...@apache.org>
(cherry picked from commit 08bd36a8745d20c5aa688f5c33a05615857d40e0)
---
M python/kudu/compat.py
M python/kudu/tests/test_client.py
M python/kudu/tests/test_scanner.py
M python/kudu/tests/test_scantoken.py
M python/kudu/tests/test_schema.py
M python/kudu/tests/util.py
6 files changed, 108 insertions(+), 51 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/81/19981/1
--
To view, visit http://gerrit.cloudera.org:8080/19981
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: branch-1.17.x
Gerrit-MessageType: newchange
Gerrit-Change-Id: I41e2d69996ee0ed0f0418ae184d95239f2739efb
Gerrit-Change-Number: 19981
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <ale...@apache.org>
Gerrit-Reviewer: Attila Bukor <abu...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <greber...@gmail.com>

Reply via email to