Skip to content

Commit

Permalink
Re-enable coverage :(
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamtt committed Dec 22, 2023
1 parent b7018b2 commit 96f2cb8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ spaces_indent_inline_array = 4
sort_first = ["tool.poetry"]

[tool.pytest.ini_options]
#addopts = "--cov=prosper_shared/omni_config --cov-report=term-missing --cov-report=lcov:dist/coverage.info --cov-fail-under=100"
addopts = "--cov=prosper_shared/omni_config --cov-report=term-missing --cov-report=lcov:dist/coverage.info --cov-fail-under=100"
testpaths = "tests"
python_functions = ["*_test", "test_*"]

Expand Down
34 changes: 34 additions & 0 deletions tests/omni_config/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,3 +365,37 @@ def test_get_config_help(self, mocker):
" }\n"
"}"
)

def test_get_config_help_no_description(self, mocker):
test_config_schema = {
"key1": str,
}
test_input_schema = {}
realize_config_schemata_mock = mocker.patch(
"prosper_shared.omni_config._realize_config_schemata"
)
realize_input_schemata_mock = mocker.patch(
"prosper_shared.omni_config._realize_input_schemata"
)
realize_config_schemata_mock.return_value = [test_config_schema]
realize_input_schemata_mock.return_value = [test_input_schema]

with pytest.raises(ValueError):
get_config_help()

def test_get_config_help_bad_value(self, mocker):
test_config_schema = {
ConfigKey("key1", description="key1 desc"): "bad_value",
}
test_input_schema = {}
realize_config_schemata_mock = mocker.patch(
"prosper_shared.omni_config._realize_config_schemata"
)
realize_input_schemata_mock = mocker.patch(
"prosper_shared.omni_config._realize_input_schemata"
)
realize_config_schemata_mock.return_value = [test_config_schema]
realize_input_schemata_mock.return_value = [test_input_schema]

with pytest.raises(ValueError):
get_config_help()

0 comments on commit 96f2cb8

Please sign in to comment.