Skip to content

Commit

Permalink
Add docker tests for open-telemetry#821
Browse files Browse the repository at this point in the history
  • Loading branch information
ffe4 committed Aug 20, 2020
1 parent b94b292 commit ad30d68
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,23 @@ def test_execute(self):
self._cursor.execute("CREATE TABLE IF NOT EXISTS test (id INT)")
self.validate_spans()

def test_execute_with_connection_context_manager(self):
"""Should create a child span for execute with connection context
"""
with self._tracer.start_as_current_span("rootSpan"):
with self._connection as conn:
cursor = conn.cursor()
cursor.execute("CREATE TABLE IF NOT EXISTS test (id INT)")
self.validate_spans()

def test_execute_with_cursor_context_manager(self):
"""Should create a child span for execute with cursor context
"""
with self._tracer.start_as_current_span("rootSpan"):
with self._connection.cursor() as cursor:
cursor.execute("CREATE TABLE IF NOT EXISTS test (id INT)")
self.validate_spans()

def test_executemany(self):
"""Should create a child span for executemany
"""
Expand Down

0 comments on commit ad30d68

Please sign in to comment.