mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 07:18:27 +01:00
Move flags from tests to config (#4943)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user