-
-
Notifications
You must be signed in to change notification settings - Fork 802
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
191 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ set -e | |
set -x | ||
|
||
# shellcheck disable=SC2068 | ||
pytest tests ${@} | ||
pytest tests ${@} -p no:warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,8 @@ | ||
import datetime | ||
import os | ||
|
||
import pytest | ||
from openai.types.chat.chat_completion_chunk import ChatCompletionChunk | ||
from openai.types.chat.chat_completion_chunk import Choice as StreamChoice | ||
from openai.types.chat.chat_completion_chunk import ChoiceDelta | ||
|
||
from sgpt.config import cfg | ||
|
||
|
||
@pytest.fixture | ||
def completion(request): | ||
tokens_string = request.param | ||
return [ | ||
ChatCompletionChunk( | ||
id="foo", | ||
model=cfg.get("DEFAULT_MODEL"), | ||
object="chat.completion.chunk", | ||
choices=[ | ||
StreamChoice( | ||
index=0, | ||
finish_reason=None, | ||
delta=ChoiceDelta(content=token, role="assistant"), | ||
), | ||
], | ||
created=int(datetime.datetime.now().timestamp()), | ||
) | ||
for token in tokens_string | ||
] | ||
@pytest.fixture(autouse=True) | ||
def mock_os_name(monkeypatch): | ||
monkeypatch.setattr(os, "name", "test") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.