diff --git a/tests/storage_adapter_tests/test_sqlalchemy_adapter.py b/tests/storage_adapter_tests/test_sqlalchemy_adapter.py index c0e539952..7ee223e98 100644 --- a/tests/storage_adapter_tests/test_sqlalchemy_adapter.py +++ b/tests/storage_adapter_tests/test_sqlalchemy_adapter.py @@ -32,7 +32,7 @@ def test_statement_not_found(self): Test that None is returned by the find method when a matching statement is not found. """ - self.assertEqual(self.adapter.find("Non-existant"), None) + self.assertIsNone(self.adapter.find("Non-existant")) def test_statement_found(self): """ @@ -43,7 +43,7 @@ def test_statement_found(self): self.adapter.update(statement) found_statement = self.adapter.find("New statement") - self.assertNotEqual(found_statement, None) + self.assertIsNotNone(found_statement) self.assertEqual(found_statement.text, statement.text) def test_update_adds_new_statement(self): @@ -51,7 +51,7 @@ def test_update_adds_new_statement(self): self.adapter.update(statement) statement_found = self.adapter.find("New statement") - self.assertNotEqual(statement_found, None) + self.assertIsNotNone(statement_found) self.assertEqual(statement_found.text, statement.text) def test_update_modifies_existing_statement(self): @@ -194,7 +194,7 @@ def test_get_response_statements(self): class SQLAlchemyStorageAdapterFilterTestCase(SQLAlchemyAdapterTestCase): def setUp(self): - super(SQLAlchemyAdapterTestCase, self).setUp() + super(SQLAlchemyStorageAdapterFilterTestCase, self).setUp() self.statement1 = Statement( "Testing...", @@ -329,7 +329,7 @@ def test_response_list_in_results(self): found = self.adapter.filter(text=statement.text) self.assertEqual(len(found[0].in_response_to), 1) - self.assertEqual(type(found[0].in_response_to[0]), Response) + self.assertIsInstance(found[0].in_response_to[0], Response) class ReadOnlySQLAlchemyDataabaseAdapterTestCase(SQLAlchemyAdapterTestCase): @@ -340,7 +340,7 @@ def test_update_does_not_add_new_statement(self): self.adapter.update(statement) statement_found = self.adapter.find("New statement") - self.assertEqual(statement_found, None) + self.assertIsNone(statement_found) def test_update_does_not_modify_existing_statement(self): statement = Statement("New statement")