source: trunk/tests/__init__.py @ 872

Last change on this file since 872 was 770, checked in by cito, 4 years ago

Add methods for getting a table as a list or dict

Also added documentation and 100% test coverage.

The get_attnames() method now always returns a read-only ordered dictionary,
even under Python 2.6 or 3.0. So you can sure the columns will be returned
in the right order if you iterate over it, and that you don't accidentally
modify the dictionary (since it is cached).

File size: 557 bytes
Line 
1"""PyGreSQL test suite.
2
3You can specify your local database settings in LOCAL_PyGreSQL.py.
4"""
5
6try:
7    import unittest2 as unittest  # for Python < 2.7
8except ImportError:
9    import unittest
10
11if not (hasattr(unittest, 'skip')
12        and hasattr(unittest.TestCase, 'setUpClass')
13        and hasattr(unittest.TestCase, 'skipTest')
14        and hasattr(unittest.TestCase, 'assertIn')):
15    raise ImportError('Please install a newer version of unittest')
16
17
18def discover():
19    loader = unittest.TestLoader()
20    suite = loader.discover('.')
21    return suite
Note: See TracBrowser for help on using the repository browser.