unit test / code coverage improvements (#322)

This PR has two contributions:

1. Add test for when stop token is found in middle of text

2. Add code coverage tooling and instructions
- Add pytest-cov via poetry
- Add necessary config files
- Add new make instruction for `coverage`
- Update README with coverage guidance
- Update minor README formatting/spelling

Co-authored-by: Hunter Gerlach <hunter@huntergerlach.com>
This commit is contained in:
Hunter Gerlach
2022-12-13 08:48:53 -05:00
committed by GitHub
parent 8861770bd0
commit 482611f426
9 changed files with 2602 additions and 2325 deletions

View File

@@ -10,6 +10,9 @@ def test_enforce_stop_tokens() -> None:
text = "foo bar baz"
output = enforce_stop_tokens(text, ["moo", "baz", "bar"])
assert output == "foo "
text = "foo bar baz"
output = enforce_stop_tokens(text, ["moo", "bar"])
assert output == "foo "
def test_enforce_stop_tokens_none() -> None: