Skip to content

Commit 36711cc

Browse files
author
Daniel Rogers
committed
Add test that trips 'Base Connection.__init__ not called.'
1 parent 25a6535 commit 36711cc

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

instrumentation/opentelemetry-instrumentation-sqlite3/tests/test_sqlite3.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@
2020
from opentelemetry.test.test_base import TestBase
2121

2222

23+
class Data:
24+
def __init__(self):
25+
self._connection = sqlite3.connect(":memory:")
26+
self._cursor = self._connection.cursor()
27+
28+
def __del__(self):
29+
self._cursor.close()
30+
self._connection.close()
31+
32+
def create_tables(self):
33+
stmt = "CREATE TABLE IF NOT EXISTS test (id integer)"
34+
self._cursor.execute(stmt)
35+
self._connection.commit()
36+
37+
2338
class TestSQLite3(TestBase):
2439
def setUp(self):
2540
super().setUp()
@@ -100,3 +115,7 @@ def test_callproc(self):
100115
):
101116
self._cursor.callproc("test", ())
102117
self.validate_spans("test")
118+
119+
def test_baseinit(self):
120+
data = Data()
121+
data.create_tables()

0 commit comments

Comments
 (0)