| 
43 | 43 | #   PYO_TEST_EXTERNAL_USER: user for testing external authentication  | 
44 | 44 | #   PYO_TEST_EDITION_NAME: name of edition for editioning tests  | 
45 | 45 | #   PYO_TEST_PLUGINS: list of plugins to import before running tests  | 
 | 46 | +#   PYO_TEST_ORACLE_CLIENT_PATH: Oracle Client or Instant Client library dir  | 
46 | 47 | #  | 
47 | 48 | # PYO_TEST_CONNECT_STRING can be set to an Easy Connect string, or a  | 
48 | 49 | # Net Service Name from a tnsnames.ora file or external naming service,  | 
49 | 50 | # or it can be the name of a local Oracle database instance.  | 
50 | 51 | #  | 
 | 52 | +# On Windows set PYO_TEST_ORACLE_CLIENT_PATH if Oracle libraries are not in  | 
 | 53 | +# PATH. On macOS set the variable to the Instant Client directory. On Linux do  | 
 | 54 | +# not set the variable; instead set LD_LIBRARY_PATH or configure ldconfig  | 
 | 55 | +# before running Python.  | 
 | 56 | +#  | 
51 | 57 | # If oracledb is using Instant Client, then an Easy Connect string is generally  | 
52 | 58 | # appropriate. The syntax is:  | 
53 | 59 | #  | 
 | 
68 | 74 | import getpass  | 
69 | 75 | import importlib  | 
70 | 76 | import os  | 
 | 77 | +import platform  | 
71 | 78 | import secrets  | 
72 | 79 | import sys  | 
73 | 80 | import string  | 
@@ -95,7 +102,7 @@ def _initialize():  | 
95 | 102 |     if PARAMETERS.get("INITIALIZED"):  | 
96 | 103 |         return  | 
97 | 104 |     if not get_is_thin() and oracledb.is_thin_mode():  | 
98 |  | -        oracledb.init_oracle_client()  | 
 | 105 | +        oracledb.init_oracle_client(lib_dir=get_oracle_client())  | 
99 | 106 |         oracledb.defaults.thick_mode_dsn_passthrough = False  | 
100 | 107 |     plugin_names = os.environ.get("PYO_TEST_PLUGINS")  | 
101 | 108 |     if plugin_names is not None:  | 
@@ -232,6 +239,11 @@ def get_client_version():  | 
232 | 239 |     return value  | 
233 | 240 | 
 
  | 
234 | 241 | 
 
  | 
 | 242 | +def get_oracle_client():  | 
 | 243 | +    if platform.system() == "Darwin" or platform.system() == "Windows":  | 
 | 244 | +        return get_value("ORACLE_CLIENT_PATH", "Oracle Instant Client Path")  | 
 | 245 | + | 
 | 246 | + | 
235 | 247 | def get_connect_params():  | 
236 | 248 |     wallet_location = get_wallet_location()  | 
237 | 249 |     return oracledb.ConnectParams(  | 
@@ -487,6 +499,8 @@ def skip_soda_tests():  | 
487 | 499 |         return True  | 
488 | 500 |     if has_server_version(20, 1) and not has_client_version(20, 1):  | 
489 | 501 |         return True  | 
 | 502 | +    if has_client_version(23, 3) and platform.system() == "Darwin":  | 
 | 503 | +        return True  | 
490 | 504 |     return False  | 
491 | 505 | 
 
  | 
492 | 506 | 
 
  | 
 | 
0 commit comments