code: def test_connection_factories(self):
      class DefectFactory(sqlite.Connection):
          def __init__(self, *args, **kwargs):
              return None
  
      class OkFactory(sqlite.Connection):
          def __init__(self, *args, **kwargs):
              sqlite.Connection.__init__(self, *args, **kwargs)
  
      with memory_database(factory=OkFactory) as con:
          self.assertIsInstance(con, OkFactory)
      regex = "Base Connection.__init__ not called."
      with self.assertRaisesRegex(sqlite.ProgrammingError, regex):
          with memory_database(factory=DefectFactory) as con:
              self.assertIsInstance(con, DefectFactory)
  
imports: import unittest
  import sqlite3
  from collections.abc import Sequence
  from .util import memory_database
  from .util import MemoryDatabaseMixin
label_desc: Use image node_id 1 for calling the ConnectionFactoryTests obj's underlying member method code with example usage: obj.test_connection_factories() and returns: None