Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added tests2/test.py

  • Loading branch information...
commit 6e873d815da65b132fd6a7b279e2b6c07059e936 1 parent 75ac6f2
@mkleehammer authored
Showing with 36 additions and 0 deletions.
  1. +36 −0 tests2/test.py
View
36 tests2/test.py
@@ -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()
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.