Changeset: 00628eb117e0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=00628eb117e0
Added Files:
        clients/examples/python/sqlsample.py
        sql/test/mapi/Tests/python2_dbapi.SQL.bat
        sql/test/mapi/Tests/python2_dbapi.SQL.sh
        sql/test/mapi/Tests/python2_dbapi.stable.err
        sql/test/mapi/Tests/python2_dbapi.stable.out
        sql/test/mapi/Tests/python3_dbapi.SQL.bat
        sql/test/mapi/Tests/python3_dbapi.SQL.sh
        sql/test/mapi/Tests/python3_dbapi.stable.err
        sql/test/mapi/Tests/python3_dbapi.stable.out
Removed Files:
        clients/examples/python/Makefile.ag
        clients/examples/python/sqlsample.py.in
        sql/test/mapi/Tests/python_dbapi.SQL.bat
        sql/test/mapi/Tests/python_dbapi.SQL.sh
        sql/test/mapi/Tests/python_dbapi.stable.err
        sql/test/mapi/Tests/python_dbapi.stable.out
Modified Files:
        clients/examples/Makefile.ag
        sql/test/mapi/Tests/All
        sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
        sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
        sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
        sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
        sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
        testing/Mtest.py.in
Branch: Feb2013
Log Message:

Merged from Oct2012


diffs (287 lines):

diff --git a/clients/examples/Makefile.ag b/clients/examples/Makefile.ag
--- a/clients/examples/Makefile.ag
+++ b/clients/examples/Makefile.ag
@@ -15,4 +15,6 @@
 # Copyright August 2008-2012 MonetDB B.V.
 # All Rights Reserved.
 
-SUBDIRS = C python php
+SUBDIRS = C php
+
+EXTRA_DIST_DIR = python
diff --git a/clients/examples/python/Makefile.ag 
b/clients/examples/python/Makefile.ag
deleted file mode 100644
--- a/clients/examples/python/Makefile.ag
+++ /dev/null
@@ -1,24 +0,0 @@
-# The contents of this file are subject to the MonetDB Public License
-# Version 1.1 (the "License"); you may not use this file except in
-# compliance with the License. You may obtain a copy of the License at
-# http://www.monetdb.org/Legal/MonetDBLicense
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-# License for the specific language governing rights and limitations
-# under the License.
-#
-# The Original Code is the MonetDB Database System.
-#
-# The Initial Developer of the Original Code is CWI.
-# Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
-# Copyright August 2008-2012 MonetDB B.V.
-# All Rights Reserved.
-
-MTSAFE
-
-scripts_py = {
-       COND = HAVE_TESTING
-       DIR = bindir
-       SOURCES = sqlsample.py.in
-}
diff --git a/clients/examples/python/sqlsample.py.in 
b/clients/examples/python/sqlsample.py
rename from clients/examples/python/sqlsample.py.in
rename to clients/examples/python/sqlsample.py
--- a/clients/examples/python/sqlsample.py.in
+++ b/clients/examples/python/sqlsample.py
@@ -1,4 +1,4 @@
-#!@PYTHON@
+#!/usr/bin/env python
 
 # The contents of this file are subject to the MonetDB Public License
 # Version 1.1 (the "License"); you may not use this file except in
@@ -33,7 +33,7 @@ print(cursor.fetchone())
 # deliberately executing a wrong SQL statement:
 try:
     cursor.execute('( xyz 1);')
-except monetdb.sql.OperationalError, e:
+except monetdb.sql.OperationalError as e:
     print(e)
 
 cursor.execute('create table python_table (i smallint,s string);');
diff --git a/sql/test/mapi/Tests/All b/sql/test/mapi/Tests/All
--- a/sql/test/mapi/Tests/All
+++ b/sql/test/mapi/Tests/All
@@ -6,7 +6,8 @@ sample4
 smack00
 smack01
 HAVE_PERL?perl_dbi
-HAVE_PYTHON?python_dbapi
+HAVE_PYTHON2?python2_dbapi
+HAVE_PYTHON3?python3_dbapi
 HAVE_GEOM&HAVE_PHP?php_monetdb
 !HAVE_GEOM&HAVE_PHP?php_monetdb_nogeom
 utf8test
diff --git a/sql/test/mapi/Tests/python_dbapi.SQL.bat 
b/sql/test/mapi/Tests/python2_dbapi.SQL.bat
rename from sql/test/mapi/Tests/python_dbapi.SQL.bat
rename to sql/test/mapi/Tests/python2_dbapi.SQL.bat
--- a/sql/test/mapi/Tests/python_dbapi.SQL.bat
+++ b/sql/test/mapi/Tests/python2_dbapi.SQL.bat
@@ -3,4 +3,11 @@
 prompt # $t $g  
 echo on
 
-sqlsample.py %MAPIPORT% %TSTDB%
+rem must be aligned with the installation directory chosen in
+rem clients/examples/python
+set testpath=%TSTSRCBASE%\..\clients\examples\python
+rem ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+rem Python that runs Mtest (currently always Python 2)
+set PYTHONPATH=%PYTHON2PATH%
+
+%PYTHON2% "%testpath%/sqlsample.py" %MAPIPORT% %TSTDB%
diff --git a/sql/test/mapi/Tests/python_dbapi.SQL.sh 
b/sql/test/mapi/Tests/python2_dbapi.SQL.sh
rename from sql/test/mapi/Tests/python_dbapi.SQL.sh
rename to sql/test/mapi/Tests/python2_dbapi.SQL.sh
--- a/sql/test/mapi/Tests/python_dbapi.SQL.sh
+++ b/sql/test/mapi/Tests/python2_dbapi.SQL.sh
@@ -1,3 +1,11 @@
 #!/bin/sh
 
-Mlog -x "sqlsample.py $MAPIPORT $TSTDB"
+# must be aligned with the installation directory chosen in
+# clients/examples/python
+testpath="$TSTSRCBASE/../clients/examples/python"
+# ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+# Python that runs Mtest (currently always Python 2)
+PYTHONPATH=${PYTHON2PATH}
+export PYTHONPATH
+
+Mlog -x "${PYTHON2} ${testpath}/sqlsample.py $MAPIPORT $TSTDB"
diff --git a/sql/test/mapi/Tests/python_dbapi.stable.err 
b/sql/test/mapi/Tests/python2_dbapi.stable.err
rename from sql/test/mapi/Tests/python_dbapi.stable.err
rename to sql/test/mapi/Tests/python2_dbapi.stable.err
--- a/sql/test/mapi/Tests/python_dbapi.stable.err
+++ b/sql/test/mapi/Tests/python2_dbapi.stable.err
@@ -1,4 +1,4 @@
-stderr of test 'python_dbapi` in directory 'test/mapi` itself:
+stderr of test 'python2_dbapi` in directory 'test/mapi` itself:
 
 
 # 22:24:36 >  
diff --git a/sql/test/mapi/Tests/python_dbapi.stable.out 
b/sql/test/mapi/Tests/python2_dbapi.stable.out
rename from sql/test/mapi/Tests/python_dbapi.stable.out
rename to sql/test/mapi/Tests/python2_dbapi.stable.out
--- a/sql/test/mapi/Tests/python_dbapi.stable.out
+++ b/sql/test/mapi/Tests/python2_dbapi.stable.out
@@ -1,4 +1,4 @@
-stdout of test 'python_dbapi` in directory 'test/mapi` itself:
+stdout of test 'python2_dbapi` in directory 'test/mapi` itself:
 
 
 # 20:08:06 >  
diff --git a/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat 
b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
--- a/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
+++ b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
@@ -3,7 +3,9 @@
 rem must be aligned with the installation directory chosen in
 rem clients/python/test/Makefile.ag
 set testpath=%TSTSRCBASE%\..\clients\python2\test
-set PYTHONPATH=%testpath%;%PYTHONPATH%
+rem ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+rem Python that runs Mtest (currently always Python 2)
+set PYTHONPATH=%testpath%;%PYTHON2PATH%
 
 prompt # $t $g  
 echo on
diff --git a/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh 
b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
--- a/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
+++ b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
@@ -3,7 +3,9 @@
 # must be aligned with the installation directory chosen in
 # clients/python/test/Makefile.ag
 testpath="$TSTSRCBASE/../clients/python2/test"
-PYTHONPATH=$testpath:$PYTHONPATH
+# ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+# Python that runs Mtest (currently always Python 2)
+PYTHONPATH=$testpath:${PYTHON2PATH}
 export PYTHONPATH
 
 Mlog -x "${PYTHON2} $testpath/runtests.py"
diff --git a/sql/test/mapi/Tests/python_dbapi.SQL.bat 
b/sql/test/mapi/Tests/python3_dbapi.SQL.bat
copy from sql/test/mapi/Tests/python_dbapi.SQL.bat
copy to sql/test/mapi/Tests/python3_dbapi.SQL.bat
--- a/sql/test/mapi/Tests/python_dbapi.SQL.bat
+++ b/sql/test/mapi/Tests/python3_dbapi.SQL.bat
@@ -3,4 +3,11 @@
 prompt # $t $g  
 echo on
 
-sqlsample.py %MAPIPORT% %TSTDB%
+rem must be aligned with the installation directory chosen in
+rem clients/examples/python
+set testpath=%TSTSRCBASE%\..\clients\examples\python
+rem ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+rem Python that runs Mtest (currently always Python 2)
+set PYTHONPATH=%PYTHON3PATH%
+
+%PYTHON3% "%testpath%/sqlsample.py" %MAPIPORT% %TSTDB%
diff --git a/sql/test/mapi/Tests/python_dbapi.SQL.sh 
b/sql/test/mapi/Tests/python3_dbapi.SQL.sh
copy from sql/test/mapi/Tests/python_dbapi.SQL.sh
copy to sql/test/mapi/Tests/python3_dbapi.SQL.sh
--- a/sql/test/mapi/Tests/python_dbapi.SQL.sh
+++ b/sql/test/mapi/Tests/python3_dbapi.SQL.sh
@@ -1,3 +1,11 @@
 #!/bin/sh
 
-Mlog -x "sqlsample.py $MAPIPORT $TSTDB"
+# must be aligned with the installation directory chosen in
+# clients/examples/python
+testpath="$TSTSRCBASE/../clients/examples/python"
+# ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+# Python that runs Mtest (currently always Python 2)
+PYTHONPATH=${PYTHON3PATH}
+export PYTHONPATH
+
+Mlog -x "${PYTHON3} ${testpath}/sqlsample.py $MAPIPORT $TSTDB"
diff --git a/sql/test/mapi/Tests/python_dbapi.stable.err 
b/sql/test/mapi/Tests/python3_dbapi.stable.err
copy from sql/test/mapi/Tests/python_dbapi.stable.err
copy to sql/test/mapi/Tests/python3_dbapi.stable.err
--- a/sql/test/mapi/Tests/python_dbapi.stable.err
+++ b/sql/test/mapi/Tests/python3_dbapi.stable.err
@@ -1,4 +1,4 @@
-stderr of test 'python_dbapi` in directory 'test/mapi` itself:
+stderr of test 'python3_dbapi` in directory 'test/mapi` itself:
 
 
 # 22:24:36 >  
diff --git a/sql/test/mapi/Tests/python_dbapi.stable.out 
b/sql/test/mapi/Tests/python3_dbapi.stable.out
copy from sql/test/mapi/Tests/python_dbapi.stable.out
copy to sql/test/mapi/Tests/python3_dbapi.stable.out
--- a/sql/test/mapi/Tests/python_dbapi.stable.out
+++ b/sql/test/mapi/Tests/python3_dbapi.stable.out
@@ -1,4 +1,4 @@
-stdout of test 'python_dbapi` in directory 'test/mapi` itself:
+stdout of test 'python3_dbapi` in directory 'test/mapi` itself:
 
 
 # 20:08:06 >  
@@ -33,7 +33,7 @@ Ready.
 (2,)
 42000!syntax error, unexpected IDENT, expecting SELECT or '(' in: "( xyz"
 
-[(3, u'three'), (7, u'seven')]
+[(3, 'three'), (7, 'seven')]
 2
 
 # 22:24:36 >  
diff --git a/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat 
b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
--- a/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
+++ b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
@@ -3,7 +3,9 @@
 rem must be aligned with the installation directory chosen in
 rem clients/python/test/Makefile.ag
 set testpath=%TSTSRCBASE%\..\clients\python3\test
-set PYTHONPATH=%testpath%;%PYTHONPATH%
+rem ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+rem Python that runs Mtest (currently always Python 2)
+set PYTHONPATH=%testpath%;%PYTHON3PATH%
 
 prompt # $t $g  
 echo on
diff --git a/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh 
b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
--- a/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
+++ b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
@@ -3,7 +3,9 @@
 # must be aligned with the installation directory chosen in
 # clients/python/test/Makefile.ag
 testpath="$TSTSRCBASE/../clients/python3/test"
-PYTHONPATH=$testpath:$PYTHONPATH
+# ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+# Python that runs Mtest (currently always Python 2)
+PYTHONPATH=$testpath:${PYTHON3PATH}
 export PYTHONPATH
 
 Mlog -x "${PYTHON3} $testpath/runtests.py"
diff --git a/sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err 
b/sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
--- a/sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
+++ b/sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
@@ -80,7 +80,6 @@ stderr of test 'python3_test_monetdb_sql
 # 11:54:47 >  
 
 test_BLOB (__main__.Test_Capabilities) ... ok
-test_BOOL (__main__.Test_Capabilities) ... ok
 test_CHAR (__main__.Test_Capabilities) ... ok
 test_DATE (__main__.Test_Capabilities) ... ok
 test_DATETIME (__main__.Test_Capabilities) ... ok
@@ -103,7 +102,7 @@ test_transactions (__main__.Test_Capabil
 test_truncation (__main__.Test_Capabilities) ... ok
 
 ----------------------------------------------------------------------
-Ran 22 tests
+Ran 21 tests
 
 OK
 test_BINARY (__main__.Test_DBAPI20) ... ok
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1164,7 +1164,9 @@ def PerformDir(env, testdir, testlist, B
     os.environ['TSTTRGDIR'] = TSTTRGDIR
     os.environ['RELSRCDIR'] = env['RELSRCDIR']
     os.environ['PYTHON2']   = '@PYTHON2@'
+    os.environ['PYTHON2PATH'] = _configure(os.path.join('@QXprefix@', 
'@PYTHON2_LIBDIR@'))
     os.environ['PYTHON3']   = '@PYTHON3@'
+    os.environ['PYTHON3PATH'] = _configure(os.path.join('@QXprefix@', 
'@PYTHON3_LIBDIR@'))
 
     #STDERR.flush()
     #for v in 'RELSRCDIR':
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to