Changeset: 930ea50bc9fc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/930ea50bc9fc
Modified Files:
        documentation/source/developers_handbook.rst
Branch: default
Log Message:

adding sqltest multiple connection example to doc


diffs (30 lines):

diff --git a/documentation/source/developers_handbook.rst 
b/documentation/source/developers_handbook.rst
--- a/documentation/source/developers_handbook.rst
+++ b/documentation/source/developers_handbook.rst
@@ -101,8 +101,8 @@ Python tests API
 ----------------
 
 We are using ``pymonetdb`` client in our testing infrastructure heavily. All 
.py tests needs to log errors in ``stderror``
-and exit abnormally if failure is present. To ease up writing testing scripts 
the ``SQLTestCase`` class from ``MonetDBtesting`` 
-module can be utilized. Following is an example of the ``SQLTestCase`` API::
+and exit abnormally if a failure is present. To ease up writing testing 
scripts the ``SQLTestCase`` class from ``MonetDBtesting`` 
+module can be utilized. Following is an example of the ``SQLTestCase`` API 
using single client::
 
     from MonetDBtesting.sqltest import SQLTestCase
 
@@ -117,4 +117,15 @@ module can be utilized. Following is an 
         tc.execute('insert into foo values (888.42), 
(444.42);').assertSucceeded().assertRowCount(2)
         tc.execute('select * from 
foo;').assertSucceeded().assertDataResultMatch([(Decimal('888.42'),), 
(Decimal('444.42'),)])
 
+Similarly testing concurrent connections with multiple clients can be written 
as::
+
+    from MonetDBtesting.sqltest import SQLTestCase
+
+    with SQLTestCase() as conn1:
+        with SQLTestCase() as conn2:
+            ...
+            do something with conn1
+            do something with conn2
+
+
 For more examples check out tests in ``sql/test/Users/Tests``.
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to