diff --git a/tests/functional/openlp_core/ui/test_formattingtagscontroller.py b/tests/functional/openlp_core/ui/test_formattingtagscontroller.py index dfd05bcf0..f4fb9f571 100644 --- a/tests/functional/openlp_core/ui/test_formattingtagscontroller.py +++ b/tests/functional/openlp_core/ui/test_formattingtagscontroller.py @@ -43,7 +43,7 @@ class TestFormattingTagController(TestCase): result = self.services._strip(tag) # THEN: The tag should be returned with the wrappers removed. - self.assertEqual(result, 'tag', 'FormattingTagForm._strip should return u\'tag\' when called with u\'{tag}\'') + assert result == 'tag', 'FormattingTagForm._strip should return u\'tag\' when called with u\'{tag}\'' def test_end_tag_changed_processes_correctly(self): """ @@ -64,11 +64,9 @@ class TestFormattingTagController(TestCase): error, result = self.services.end_tag_changed(test['start'], test['end']) # THEN: The result should match the predetermined value. - self.assertTrue(result == test['gen'], - 'Function should handle end tag correctly : %s and %s for %s ' % - (test['gen'], result, test['start'])) - self.assertTrue(error == test['valid'], 'Function should not generate unexpected error messages : %s ' % - error) + assert result == test['gen'], \ + 'Function should handle end tag correctly : %s and %s for %s ' % (test['gen'], result, test['start']) + assert error == test['valid'], 'Function should not generate unexpected error messages : %s ' % error def test_start_tag_changed_processes_correctly(self): """ @@ -88,10 +86,9 @@ class TestFormattingTagController(TestCase): error, result = self.services.start_tag_changed(test['start'], test['end']) # THEN: The result should match the predetermined value. - self.assertTrue(result == test['gen'], 'Function should handle end tag correctly : %s and %s ' % - (test['gen'], result)) - self.assertTrue(error == test['valid'], 'Function should not generate unexpected error messages : %s ' % - error) + assert result == test['gen'], \ + 'Function should handle end tag correctly : %s and %s ' % (test['gen'], result) + assert error == test['valid'], 'Function should not generate unexpected error messages : %s ' % error def test_start_html_to_end_html(self): """ @@ -106,5 +103,4 @@ class TestFormattingTagController(TestCase): result = self.services.start_html_to_end_html(test1) # THEN: The result should match the predetermined value. - self.assertTrue(result == test2, 'Calculated end tag should be valid: %s and %s = %s' % - (test1, test2, result)) + assert result == test2, 'Calculated end tag should be valid: %s and %s = %s' % (test1, test2, result) diff --git a/tests/functional/openlp_core/ui/test_formattingtagsform.py b/tests/functional/openlp_core/ui/test_formattingtagsform.py index c4069a553..e45f94855 100644 --- a/tests/functional/openlp_core/ui/test_formattingtagsform.py +++ b/tests/functional/openlp_core/ui/test_formattingtagsform.py @@ -83,8 +83,8 @@ class TestFormattingTagForm(TestCase): call(row_count, 2, mocked_table_widget), call(row_count, 3, mocked_table_widget) ] - self.assertEqual(expected_set_item_calls, form.tag_table_widget.setItem.call_args_list, - 'setItem should have been called correctly') + assert expected_set_item_calls == form.tag_table_widget.setItem.call_args_list, \ + 'setItem should have been called correctly' form.tag_table_widget.resizeRowsToContents.assert_called_with() form.tag_table_widget.scrollToBottom.assert_called_with() form.tag_table_widget.selectRow.assert_called_with(row_count)