chore: enable lint PT009 'use regular assert over self.assert.*' (#30521)

This commit is contained in:
Maxime Beauchemin
2024-10-07 13:17:27 -07:00
committed by GitHub
parent 1f013055d2
commit a849c29288
62 changed files with 2218 additions and 2422 deletions

View File

@@ -53,8 +53,8 @@ class EncryptedFieldTest(SupersetTestCase):
def test_create_field(self):
field = encrypted_field_factory.create(String(1024))
self.assertTrue(isinstance(field, EncryptedType))
self.assertEqual(self.app.config["SECRET_KEY"], field.key)
assert isinstance(field, EncryptedType)
assert self.app.config["SECRET_KEY"] == field.key
def test_custom_adapter(self):
self.app.config["SQLALCHEMY_ENCRYPTED_FIELD_TYPE_ADAPTER"] = (
@@ -62,10 +62,10 @@ class EncryptedFieldTest(SupersetTestCase):
)
encrypted_field_factory.init_app(self.app)
field = encrypted_field_factory.create(String(1024))
self.assertTrue(isinstance(field, StringEncryptedType))
self.assertFalse(isinstance(field, EncryptedType))
self.assertTrue(getattr(field, "__created_by_enc_field_adapter__"))
self.assertEqual(self.app.config["SECRET_KEY"], field.key)
assert isinstance(field, StringEncryptedType)
assert not isinstance(field, EncryptedType)
assert getattr(field, "__created_by_enc_field_adapter__")
assert self.app.config["SECRET_KEY"] == field.key
def test_ensure_encrypted_field_factory_is_used(self):
"""

View File

@@ -25,7 +25,7 @@ class MachineAuthProviderTests(SupersetTestCase):
def test_get_auth_cookies(self):
user = self.get_user("admin")
auth_cookies = machine_auth_provider_factory.instance.get_auth_cookies(user)
self.assertIsNotNone(auth_cookies["session"])
assert auth_cookies["session"] is not None
@patch("superset.utils.machine_auth.MachineAuthProvider.get_auth_cookies")
def test_auth_driver_user(self, get_auth_cookies):