diff options
author | Jens Carl <j.carl43@gmx.de> | 2019-11-17 10:55:29 -0800 |
---|---|---|
committer | Muhammet Kara <muhammet.kara@collabora.com> | 2019-11-18 13:35:44 +0100 |
commit | c0e720bfd209b50ca7dc2082e340f9b6288a6216 (patch) | |
tree | 6632f0e8fa956e4f2a8dcf95421b0fdd16ae9278 /uitest | |
parent | f23b9ae6bbc4a82e4e9258a6a1d8ca84d6b5d8ec (diff) |
Fix 'is' operator for comparison
The 'is' operator should not be used for comparison on some types of
literals. In CPython this works by accident and CPython 3.8 introduced a
SyntaxWarning (see https://bugs.python.org/issue34850).
Change-Id: Ic4ba481579d13fd1496431ded59dd626a05fc0c6
Reviewed-on: https://gerrit.libreoffice.org/83033
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/test_main.py | 2 | ||||
-rw-r--r-- | uitest/writer_tests/customizeDialog.py | 4 | ||||
-rw-r--r-- | uitest/writer_tests/start.py | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/uitest/test_main.py b/uitest/test_main.py index 851a44f8e929..ab173c32476c 100644 --- a/uitest/test_main.py +++ b/uitest/test_main.py @@ -54,7 +54,7 @@ def find_test_files(dir_path): # ignore the __init__.py file # it is obviously not a test file - if f is "__init__.py": + if f == "__init__.py": continue valid_files.append(file_path) diff --git a/uitest/writer_tests/customizeDialog.py b/uitest/writer_tests/customizeDialog.py index 9d2311eb46a6..fa187c36ac35 100644 --- a/uitest/writer_tests/customizeDialog.py +++ b/uitest/writer_tests/customizeDialog.py @@ -34,7 +34,7 @@ class ConfigureDialog(UITestCase): xSearch = xDialog.getChild("searchEntry") initialEntryCount = get_state_as_dict(xfunc)["Children"] - self.assertTrue(initialEntryCount is not 0) + self.assertTrue(initialEntryCount != 0) xSearch.executeAction("SET", mkPropertyValues({"TEXT":"format"})) @@ -67,7 +67,7 @@ class ConfigureDialog(UITestCase): xCategory = xDialog.getChild("commandcategorylist") initialEntryCount = get_state_as_dict(xFunc)["Children"] - self.assertTrue(initialEntryCount is not 0) + self.assertTrue(initialEntryCount != 0) select_pos(xCategory, "1") filteredEntryCount = get_state_as_dict(xFunc)["Children"] diff --git a/uitest/writer_tests/start.py b/uitest/writer_tests/start.py index c8cbcbba4884..5851e8eff7c9 100644 --- a/uitest/writer_tests/start.py +++ b/uitest/writer_tests/start.py @@ -45,7 +45,7 @@ class SimpleWriterTest(UITestCase): xWriterEdit = xWriterDoc.getChild("writer_edit") state = get_state_as_dict(xWriterEdit) - while state["CurrentPage"] is "1": + while state["CurrentPage"] == "1": xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) state = get_state_as_dict(xWriterEdit) |