Skip to content

Commit

Permalink
Add test that trips 'Base Connection.__init__ not called.'
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Rogers committed Dec 8, 2022
1 parent 25a6535 commit 36711cc
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@
from opentelemetry.test.test_base import TestBase


class Data:
def __init__(self):
self._connection = sqlite3.connect(":memory:")
self._cursor = self._connection.cursor()

def __del__(self):
self._cursor.close()
self._connection.close()

def create_tables(self):
stmt = "CREATE TABLE IF NOT EXISTS test (id integer)"
self._cursor.execute(stmt)
self._connection.commit()


class TestSQLite3(TestBase):
def setUp(self):
super().setUp()
Expand Down Expand Up @@ -100,3 +115,7 @@ def test_callproc(self):
):
self._cursor.callproc("test", ())
self.validate_spans("test")

def test_baseinit(self):
data = Data()
data.create_tables()

0 comments on commit 36711cc

Please sign in to comment.