Move flags from tests to config (#4943)

This commit is contained in:
Saugat Pachhai
2020-11-23 16:21:24 +05:45
committed by GitHub
parent f1efc8f409
commit e33274723d
4 changed files with 14 additions and 6 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ jobs:
mkdir -p scripts/ci
echo "$GS_CREDS_JSON" > scripts/ci/gcp-creds.json
- name: run tests
run: python -m tests --all -ra --cov-report=xml --cov-report=term --tap-combined
run: python -m tests --all --cov-report=xml --cov-report=term --tap-combined
- name: upload coverage report
uses: codecov/[email protected]
with:
+6
View File
@@ -18,3 +18,9 @@ count=true
profile=black
known_first_party=dvc,tests
line_length=79
[tool:pytest]
timeout = 600
timeout_method = thread
log_level = debug
addopts = -ra
+1 -4
View File
@@ -16,8 +16,5 @@ os.putenv("DVC_HOME", REPO_ROOT)
params = " ".join(sys.argv[1:])
cmd = (
"py.test -v -n=4 --timeout=600 --timeout_method=thread --log-level=debug"
" --cov=dvc {params} --durations=0".format(params=params)
)
cmd = "pytest -v -n=4 --cov=dvc --durations=0 {params}".format(params=params)
check_call(cmd, shell=True)
+6 -1
View File
@@ -1,4 +1,5 @@
import os
from contextlib import suppress
import pytest
@@ -30,7 +31,11 @@ def reset_loglevel(request, caplog):
Use it to ensure log level at the start of each test
regardless of dvc.logger.setup(), Repo configs or whatever.
"""
level = request.config.getoption("--log-level")
ini_opt = None
with suppress(ValueError):
ini_opt = request.config.getini("log_level")
level = request.config.getoption("--log-level") or ini_opt
if level:
with caplog.at_level(level.upper(), logger="dvc"):
yield