mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-02 03:26:17 +00:00
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:
@@ -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:
|
||||
|
Reference in New Issue
Block a user