[pydal] Running tests on the local machine

52 views
Skip to first unread message

subbaram...@gmail.com

unread,
Dec 24, 2014, 12:07:56 AM12/24/14
to
Hello,
I recently cloned the pydal repository, and imported it into Eclipse (Luna).
Went ahead and right-clicked on the "tests" folder, and selected the "Run As > Python unit-test" option.
The output I see in the Eclipse console, is below.
My questions are:
  • Is this - running pydal tests from within Eclipse - even an option that you think needs to be considered?
  • If so, is there a way I can run the pydal tests from within Eclipse, and if so what are the parameters that I need to configure? Should I reference the .travis.yml to understand the required parameters?
  • Do I post pydal questions here (web2py-dev or web2py-users), or do I use the pydal issues to raise questions, or any other space you suggest?
Thank you for making pydal - making the DAL separate from web2py is an attractive option for me.

---------------------------------------------------------------------------------------------------------
Finding files... done.
Importing test modules ... Testing against sqlite engine (sqlite:memory)
Testing against sqlite engine (sqlite:memory)
done.

======================================================================
ERROR: testRun (tests.nosql.TestImportExportUuidFields)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\code\git\pydal\tests\nosql.py", line 774, in testRun
    db.import_from_csv_file(stream)
  File "D:\code\git\pydal\pydal\base.py", line 1125, in import_from_csv_file
    *args, **kwargs)
  File "D:\code\git\pydal\pydal\objects.py", line 969, in import_from_csv_file
    curr_id = self.insert(**dict(items))
  File "D:\code\git\pydal\pydal\objects.py", line 736, in insert
    ret =  self._db._adapter.insert(self, self._listify(fields))
  File "D:\code\git\pydal\pydal\adapters\base.py", line 714, in insert
    raise e
IntegrityError: foreign key constraint failed

======================================================================
ERROR: testInsert (tests.nosql.TestRNameFields)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\code\git\pydal\tests\nosql.py", line 1186, in testInsert
    self.assertEqual(isinstance(db.tt.insert(aa='1'), long), True)
  File "D:\code\git\pydal\pydal\objects.py", line 736, in insert
    ret =  self._db._adapter.insert(self, self._listify(fields))
  File "D:\code\git\pydal\pydal\adapters\base.py", line 714, in insert
    raise e
OperationalError: near "very": syntax error

======================================================================
ERROR: testRun (tests.nosql.TestRNameFields)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\code\git\pydal\tests\nosql.py", line 1117, in testRun
    self.assertEqual(isinstance(db.tt.insert(aa='x'), long), True)
  File "D:\code\git\pydal\pydal\objects.py", line 736, in insert
    ret =  self._db._adapter.insert(self, self._listify(fields))
  File "D:\code\git\pydal\pydal\adapters\base.py", line 714, in insert
    raise e
OperationalError: near "very": syntax error

======================================================================
ERROR: testSelect (tests.nosql.TestRNameFields)
----------------------------------------------------------------------
Traceback (most recent call last):
 
File "D:\code\git\pydal\tests\nosql.py", line 1003, in testSelect
   
Field('rating', 'integer', rname=rname2, default=2)
 
File "D:\code\git\pydal\pydal\base.py", line 821, in define_table
    table
= self.lazy_define_table(tablename,*fields,**args)
 
File "D:\code\git\pydal\pydal\base.py", line 858, in lazy_define_table
    polymodel
=polymodel)
 
File "D:\code\git\pydal\pydal\adapters\base.py", line 458, in create_table
   
self.create_sequence_and_triggers(query,table)
 
File "D:\code\git\pydal\pydal\adapters\base.py", line 1299, in create_sequence_and_triggers
   
self.execute(query)
 
File "D:\code\git\pydal\pydal\adapters\base.py", line 1318, in execute
   
return self.log_execute(*a, **b)
 
File "D:\code\git\pydal\pydal\adapters\base.py", line 1312, in log_execute
    ret
= self.cursor.execute(command, *a[1:], **b)
OperationalError: near "from": syntax error



======================================================================
ERROR: testSelect (tests.nosql.TestRNameTable)
----------------------------------------------------------------------
Traceback (most recent call last):
 
File "D:\code\git\pydal\tests\nosql.py", line 907, in testSelect
    rname
=rname
 
File "D:\code\git\pydal\pydal\base.py", line 821, in define_table
    table
= self.lazy_define_table(tablename,*fields,**args)
 
File "D:\code\git\pydal\pydal\base.py", line 858, in lazy_define_table
    polymodel
=polymodel)
 
File "D:\code\git\pydal\pydal\adapters\base.py", line 458, in create_table
   
self.create_sequence_and_triggers(query,table)
 
File "D:\code\git\pydal\pydal\adapters\base.py", line 1299, in create_sequence_and_triggers
   
self.execute(query)
 
File "D:\code\git\pydal\pydal\adapters\base.py", line 1318, in execute
   
return self.log_execute(*a, **b)
 
File "D:\code\git\pydal\pydal\adapters\base.py", line 1312, in log_execute
    ret
= self.cursor.execute(command, *a[1:], **b)
OperationalError: near "very": syntax error



----------------------------------------------------------------------
Ran 88 tests in 1.907s

FAILED (errors=5, skipped=3)
---------------------------------------------------------------------------------------

Giovanni Barillari

unread,
Dec 24, 2014, 6:46:04 AM12/24/14
to web2py-d...@googlegroups.com
Hi,
can you please open an issue on github about this?

I think we can take a look on it before the first release.


/Giovanni

subbaram...@gmail.com

unread,
Dec 24, 2014, 7:53:45 PM12/24/14
to web2py-d...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages