11This directory contains the test suite for python-oracledb.
22
3- 1 . The schemas and SQL objects that are referenced in the test suite can be
4- created by running the Python script [ create_schema.py] [ 1 ] . The script
5- requires administrative privileges and will prompt for these credentials as
6- well as the names of the schemas that will be created, unless a number of
7- environment variables are set as documented in the Python script
8- [ test_env.py] [ 2 ] . Run the script using the following command:
3+ 1 . Install pytest and tox:
4+
5+ python -m pip install pytest tox --upgrade
96
10- python create_schema.py
7+ 2 . Set the required database credential and related environment variables
8+ documented in [ conftest.py] [ 2 ] .
119
12- 2 . Install tox:
10+ 3 . The schemas and SQL objects that are referenced in the test suite can be
11+ created by running the Python script [ create_schema.py] [ 1 ] . The script
12+ requires administrative privileges to complete successfully:
1313
14- python -m pip install tox --upgrade
14+ python -m pytest tests/create_schema.py
1515
16- 3 . Run the test suite by issuing the following command in the top-level
16+ 4 . Run the test suite by issuing the following command in the top-level
1717 directory of your oracledb installation:
1818
1919 python -m tox
@@ -23,22 +23,26 @@ This directory contains the test suite for python-oracledb.
2323 Alternatively, you can use the currently installed build of oracledb and
2424 run the following command instead:
2525
26- python -m unittest discover -v -s tests
26+ python -m pytest
2727
2828 You may also run each of the test scripts independently, as in:
2929
30- python test_1000_module.py
30+ python -m pytest tests/ test_1000_module.py
3131
32- 4 . After running the test suite, the schemas can be dropped by running the
32+ The tests run in thin mode by default. If you wish to run the tests in
33+ thick mode, use the following command:
34+
35+ python -m pytest --use-thick-mode
36+
37+ 5 . After running the test suite, the schemas can be dropped by running the
3338 Python script [ drop_schema.py] [ 3 ] . The script requires administrative
34- privileges and will prompt for these credentials as well as the names of
35- the schemas that will be dropped, unless a number of environment variables
36- are set as documented in the Python script [ test_env.py] [ 2 ] . Run the
39+ privileges to complete successfully. A set of environment variables should
40+ be set as documented in the Python script [ conftest.py] [ 2 ] . Run the
3741 script using the following command:
3842
39- python drop_schema.py
43+ python -m pytest tests/ drop_schema.py
4044
41- 5 . Enable tests that require extra configuration
45+ 6 . Enable tests that require extra configuration
4246
4347 The following test(s) are automatically skipped if their required
4448 environment variable(s) and setup is not available.
@@ -64,7 +68,8 @@ This directory contains the test suite for python-oracledb.
6468 alter user <Schema Owner> grant connect through <External User>;
6569
6670
71+
6772[ 1 ] : https://github.com/oracle/python-oracledb/blob/main/tests/create_schema.py
68- [ 2 ] : https://github.com/oracle/python-oracledb/blob/main/tests/test_env .py
73+ [ 2 ] : https://github.com/oracle/python-oracledb/blob/main/tests/conftest .py
6974[ 3 ] : https://github.com/oracle/python-oracledb/blob/main/tests/drop_schema.py
7075[ 4 ] : https://python-oracledb.readthedocs.io/en/latest/user_guide/connection_handling.html#connecting-using-external-authentication
0 commit comments