def test_unwrap_connect(self):
     wrappers.wrap_connect(self.tracer, "-")
     aiopg_mock = AiopgMock()
     with mock.patch("aiopg.connect", aiopg_mock.connect):
         connection = async_call(aiopg.connect())
         self.assertEqual(aiopg_mock.connect_call_count, 1)
         wrappers.unwrap_connect()
         connection = async_call(aiopg.connect())
         self.assertEqual(aiopg_mock.connect_call_count, 2)
         self.assertIsInstance(connection, mock.Mock)
Ejemplo n.º 2
0
 def _uninstrument(self, **kwargs):
     """"Disable aiopg instrumentation"""
     wrappers.unwrap_connect()
     wrappers.unwrap_create_pool()