-
Notifications
You must be signed in to change notification settings - Fork 562
/
tox.ini
41 lines (39 loc) · 1.56 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# USAGE
# First, install tox. Tox should typically be available from the command line, so it
# is recommended to install it using pipx (pipx install tox).
#
# The unit test scripts get database connection strings from environment variables,
# and those values should be stored in a "pytest.ini" configuration file in this
# directory. Here is an example of pytest.ini:
#
# [pytest]
# env =
# PYODBC_SQLSERVER=DSN=pyodbc-sqlserver
# PYODBC_POSTGRESQL=DSN=pyodbc-postgres
# PYODBC_MYSQL=DSN=mysql;charset=utf8mb4
# # addopts=-rA --disable-warnings
# # pythonpath=.
#
# Set PYODBC_SQLSERVER, PYODBC_POSTGRESQL, and PYODBC_MYSQL accordingly.
#
# Naturally, test databases must be up and available before running the tests.
# Run the unit tests against multiple versions of Python by calling "tox" from
# this directory. To run tests against only one version of Python, call, for
# example, "tox -e py37".
# To run tests against only certain databases, comment out the relevant "pytest"
# commands below.
# To override the pytest default parameters, use "--", e.g. "tox -e py37 -- -rA".
[tox]
skipsdist = true
env_list = py{37,38,39,310,311}
[testenv]
description = Run the pyodbc unit tests
deps =
pytest
pytest-env
sitepackages = false
commands =
python -m pip install --quiet --force-reinstall --no-deps .
python -m pytest {posargs:--no-header --disable-warnings} ./tests/sqlserver_test.py
python -m pytest {posargs:--no-header --disable-warnings} ./tests/postgresql_test.py
python -m pytest {posargs:--no-header --disable-warnings} ./tests/mysql_test.py