Changeset: 367bcf9acaf6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=367bcf9acaf6
Modified Files:
testing/sqllogictest.py
Branch: Jun2020
Log Message:
Be slightly more verbose when printing error message.
diffs (35 lines):
diff --git a/testing/sqllogictest.py b/testing/sqllogictest.py
--- a/testing/sqllogictest.py
+++ b/testing/sqllogictest.py
@@ -29,11 +29,12 @@ class SQLLogicSyntaxError(Exception):
pass
class SQLLogic:
- def __init__(self, out=sys.stdout):
+ def __init__(self, database=None, out=sys.stdout):
self.dbh = None
self.crs = None
self.out = out
self.res = None
+ self.dbs = database
def connect(self, username='monetdb', password='monetdb',
hostname='localhost', port=None, database='demo'):
@@ -108,6 +109,8 @@ class SQLLogic:
return ndata
def query_error(self, query, message, exception=None):
+ if self.dbs is not None:
+ print('On database {}:'.format(self.dbs), file=self.out)
print(message, file=self.out)
if exception:
print(exception.rstrip('\n'), file=self.out)
@@ -280,7 +283,7 @@ if __name__ == '__main__':
parser.add_argument('tests', nargs='*', help='tests to be run')
opts = parser.parse_args()
args = opts.tests
- sql = SQLLogic()
+ sql = SQLLogic(database=opts.database)
sql.res = opts.results
sql.connect(hostname=opts.host, port=opts.port, database=opts.database)
for test in args:
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list