/[thuban]/branches/WIP-pyshapelib-bramz/test/runtests.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/test/runtests.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 292 by bh, Fri Aug 30 09:44:12 2002 UTC revision 1269 by bh, Fri Jun 20 16:10:22 2003 UTC
# Line 1  Line 1 
1  # Copyright (c) 2002 by Intevation GmbH  # Copyright (c) 2002, 2003 by Intevation GmbH
2  # Authors:  # Authors:
3  # Bernhard Herzog <[email protected]>  # Bernhard Herzog <[email protected]>
4  #  #
# Line 11  Main entry point for the Thuban test sui Line 11  Main entry point for the Thuban test sui
11  Just run this file as a python script to execute all tests  Just run this file as a python script to execute all tests
12  """  """
13    
14    __version__ = "$Revision$"
15    # $Source$
16    # $Id$
17    
18  import os, sys  import os, sys
19    import warnings
20  import unittest  import unittest
21    
22  import support  import support
# Line 22  import Thuban.Lib.connector Line 26  import Thuban.Lib.connector
26  def main():  def main():
27      """Run all the tests in the Thuban test suite"""      """Run all the tests in the Thuban test suite"""
28    
29      Thuban.Lib.connector._the_connector.print_connections()      # Turn Thuban's deprecation warnings into errors so they're cought
30        # by the tests
31        #
32        # Maintenance: Keep a warning filter until the backwards
33        # compatibility code is removed at which time using the old
34        # interfaces should lead to other errors anyway.
35    
36        # The layer attributes table, shapetable, shapefile and filename are
37        # deprecated.
38        warnings.filterwarnings("error", "The Layer attribute.*is deprecated",
39                                DeprecationWarning)
40    
41        # Usage of the old table interface. This old interface is still used
42        # by the test_table.py module which calls filterwarnings too to
43        # ignore the warnings issued by its own intended use of the old
44        # interface.
45        warnings.filterwarnings("error", ".*old table interface.*",
46                                DeprecationWarning)
47    
48    
49        # All Python files starting with test in the current directory
50        # contain test cases.
51        # FIXME: It should be possible to run runtests.py even when not in
52        # the test directory
53      files = os.listdir(os.curdir)      files = os.listdir(os.curdir)
54      names = []      names = []
55      for file in files:      for file in files:
# Line 34  def main(): Line 60  def main():
60      runner = unittest.TextTestRunner(verbosity = 2)      runner = unittest.TextTestRunner(verbosity = 2)
61      result = runner.run(suite)      result = runner.run(suite)
62    
63      Thuban.Lib.connector._the_connector.print_connections()      support.print_additional_summary()
64    
65      sys.exit(not result.wasSuccessful())      sys.exit(not result.wasSuccessful())
66    

Legend:
Removed from v.292  
changed lines
  Added in v.1269

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26