Permalink
Browse files

Added tests2/test.py

  • Loading branch information...
mkleehammer committed Sep 29, 2012
1 parent 75ac6f2 commit 6e873d815da65b132fd6a7b279e2b6c07059e936
Showing with 36 additions and 0 deletions.
  1. +36 −0 tests2/test.py
View
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+
+from testutils import *
+
+add_to_path()
+import pyodbc
+
+def main():
+ from optparse import OptionParser
+ parser = OptionParser()
+ parser.add_option("-v", "--verbose", action="count", help="Increment test verbosity (can be used multiple times)")
+ parser.add_option("-d", "--debug", action="store_true", default=False, help="Print debugging items")
+
+ (options, args) = parser.parse_args()
+
+ if len(args) > 1:
+ parser.error('Only one argument is allowed. Do you need quotes around the connection string?')
+
+ if not args:
+ connection_string = load_setup_connection_string('test')
+ if not connection_string:
+ parser.print_help()
+ raise SystemExit()
+ else:
+ connection_string = args[0]
+
+ cnxn = pyodbc.connect(connection_string)
+
+ if options.verbose:
+ print_library_info(cnxn)
+
+
+if __name__ == '__main__':
+ main()
+
+

0 comments on commit 6e873d8

Please sign in to comment.