Skip to content

Commit 797dcc6

Browse files
authored
Testing: run Coverage report only on CircleCI (#10611)
* Testing: run Coverage report only on CircleCI due to Python debugger I've been hitting an issue while debugging test cases that it doesn't stop exactly where I put the breakpoint. This has been pretty annoying since I'm in the middle of an inner function and I have to do multiple steps forward to find the exact place where I put my breakpoint. Today I found this problem is due to an incompatibility of `pytest-cov` and the debuggers: https://pytest-cov.readthedocs.io/en/latest/debuggers.html. * Declare the variable in the Python Docker container
1 parent 3ea15bd commit 797dcc6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.circleci/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
- image: 'cimg/python:3.10'
1111
environment:
1212
TOX_POSARGS: ''
13+
PYTEST_COVERAGE: --cov-report=xml --cov-config .coveragerc --cov=. --cov-append
1314
- image: 'docker.elastic.co/elasticsearch/elasticsearch:7.14.0'
1415
name: search
1516
environment:

tox.ini

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@ deps =
1616
-r requirements/testing.txt
1717
basepython =
1818
python3.10
19+
# https://pytest-cov.readthedocs.io/en/latest/debuggers.html
20+
# https://github.com/microsoft/vscode-python/issues/693
1921
commands =
2022
sh -c '\
2123
export DJANGO_SETTINGS_MODULE=readthedocs.settings.test; \
22-
pytest --cov-report=xml --cov-config .coveragerc --cov=. --pyargs readthedocs --suppress-no-test-exit-code -m "not proxito and not embed_api" {posargs:{env:TOX_POSARGS:-m "not search and not proxito and not embed_api"}}'
24+
pytest {env:PYTEST_COVERAGE} --pyargs readthedocs --suppress-no-test-exit-code -m "not proxito and not embed_api" {posargs:{env:TOX_POSARGS:-m "not search and not proxito and not embed_api"}}'
2325

2426
sh -c '\
2527
export DJANGO_SETTINGS_MODULE=readthedocs.settings.proxito.test; \
26-
pytest --cov-report=xml --cov-config .coveragerc --cov=. --cov-append --pyargs readthedocs -m proxito --suppress-no-test-exit-code {posargs}'
28+
pytest {env:PYTEST_COVERAGE} --pyargs readthedocs -m proxito --suppress-no-test-exit-code {posargs}'
2729
allowlist_externals =
2830
sh
2931
git

0 commit comments

Comments
 (0)