From fbecc75b370818819d055ca1e5c0edc0d665ef47 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 27 Jul 2023 11:22:51 -0500 Subject: [PATCH] PYTHON-3844 Enable Pytest XML Reporting in Tox (#1330) --- .evergreen/config.yml | 2 +- pytest.ini | 1 + tox.ini | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 6eb5bce7f2..1779110e8d 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -565,7 +565,7 @@ functions: set -o xtrace # This is required for pypy3.7 UTF encoding export LC_ALL=en_US.UTF-8 - ${PYTHON_BINARY} -m tox -e test-atlas + ${PYTHON_BINARY} -m tox -m test-atlas "add aws auth variables to file": - command: shell.exec diff --git a/pytest.ini b/pytest.ini index daf6168964..dd1ab56a57 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,3 +2,4 @@ testpaths = test norecursedirs = test/* +addopts = -ra --junitxml=xunit-results/TEST-results.xml diff --git a/tox.ini b/tox.ini index bfaab4a62f..fc59d53a02 100644 --- a/tox.ini +++ b/tox.ini @@ -46,7 +46,7 @@ deps = pytest>=7 commands = python --version - pytest -v -rs {posargs} + pytest -v {posargs} [testenv:test-encryption] description = run base unit tests with encryption enabled @@ -54,7 +54,7 @@ deps = {[testenv:test]deps} extras = encryption commands = python --version - pytest {posargs} + pytest -v {posargs} [testenv:lint] description = run pre-commit @@ -145,7 +145,7 @@ deps = {[testenv:test]deps} passenv = * commands = - python -m pytest -v ./test/atlas/test_connection.py + python -m pytest -v {posargs} ./test/atlas/test_connection.py [testenv:test-mockupdb] description = run mockupdb tests @@ -154,4 +154,4 @@ deps = https://github.com/ajdavis/mongo-mockup-db/archive/master.zip passenv = * commands = - python -m pytest -v ./test/mockupdb + python -m pytest -v {posargs} ./test/mockupdb