Skip to content

Commit 2786afd

Browse files
author
Alex Remedios
authored
Merge pull request #10 from treebeardtech:text-context
context flag
2 parents 27ead4b + 78a6b85 commit 2786afd

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

python-cli/src/deeptest/pytest_plugin.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,33 @@
11
import shutil
2+
import sys
23
from typing import Any, List, cast
34

45
from _pytest.config import Config
56
from _pytest.config.argparsing import Parser
67
from pytest import ExitCode, hookimpl
78

89
out_path = ".deeptest/junit.xml"
9-
import sys
1010

1111

1212
def is_enabled(config: Config) -> bool:
13-
return not cast(bool, config.option.no_cov) and cast(bool, config.option.cov_source)
13+
return not cast(bool, config.option.no_cov) and bool(config.option.cov_source)
1414

1515

1616
@hookimpl(hookwrapper=True)
1717
def pytest_load_initial_conftests(
1818
early_config: Config, parser: Parser, args: List[str]
1919
):
20-
# raise Exception()
2120
if sys.gettrace():
2221
early_config.known_args_namespace.cov_source = None
23-
# early_config.pluginmanager.set_blocked('pytest_cov')
2422
early_config.option.no_cov = True
25-
# args=["--no-cov"]
23+
24+
early_config.known_args_namespace.cov_context = "test"
2625

2726
yield
2827

2928

30-
# def pytest_sessionstart(session):
31-
# pass
3229
def pytest_configure(config: Config):
3330
if is_enabled(config) and config.option.xmlpath is None:
34-
# 1/0
3531
config.option.xmlpath = out_path
3632

3733

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
[pytest]
22
addopts =
33
--cov=src
4-
--cov-context=test

0 commit comments

Comments
 (0)