MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / setUpClass

Method setUpClass

tests/test_connect.py:408–430  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

406class TestGssAuthentication(BaseTestAuthentication):
407 @classmethod
408 def setUpClass(cls):
409 try:
410 from k5test.realm import K5Realm
411 except ModuleNotFoundError:
412 raise unittest.SkipTest('k5test not installed')
413
414 cls.realm = K5Realm()
415 cls.addClassCleanup(cls.realm.stop)
416 # Setup environment before starting the cluster.
417 patch = unittest.mock.patch.dict(os.environ, cls.realm.env)
418 patch.start()
419 cls.addClassCleanup(patch.stop)
420 # Add credentials.
421 cls.realm.addprinc('postgres/localhost')
422 cls.realm.extract_keytab('postgres/localhost', cls.realm.keytab)
423
424 cls.USERS = [
425 (cls.realm.user_princ, 'gss', None),
426 (f'wrong-{cls.realm.user_princ}', 'gss', None),
427 ]
428 super().setUpClass()
429
430 cls.cluster.override_connection_spec(host='localhost')
431
432 @classmethod
433 def get_server_settings(cls):

Callers 1

setUpClassMethod · 0.45

Calls 2

startMethod · 0.45

Tested by

no test coverage detected