Skip to content

Commit dbcae99

Browse files
committed
chore: simplify tox configuration
1 parent d9cf94d commit dbcae99

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

.github/workflows/run_tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
env:
3333
GPTSCRIPT_BIN: ../gptscriptexe
3434
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
35-
run: ./scripts/test
35+
run: tox
3636

3737
test-windows:
3838
runs-on: windows-latest
@@ -54,4 +54,4 @@ jobs:
5454
env:
5555
GPTSCRIPT_BIN: ..\gptscript.exe
5656
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
57-
run: ./scripts/test
57+
run: tox

scripts/test

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/test_gptscript.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import os
2+
23
import pytest
4+
35
from gptscript.command import (
46
version,
57
list_models,
@@ -118,16 +120,16 @@ def test_stream_exec_complex_tool(complex_tool):
118120
out, err, wait = stream_exec(complex_tool)
119121
resp = wait() # Wait for streaming to complete
120122
assert (
121-
out is not None or err is not None
123+
out is not None or err is not None
122124
), "Expected some output or error from stream_exec using complex_tool"
123125
assert (
124-
resp == 0
126+
resp == 0
125127
), "Expected a successful response from stream_exec using complex_tool"
126128

127129

128130
def test_exec_file_with_chdir():
129-
# By changing the directory here, we should be able to find the test.gpt file without `./test`
130-
out, err = exec_file("./test.gpt", opts={"chdir": "./fixtures"})
131+
# By changing the directory here, we should be able to find the test.gpt file without `./tests`
132+
out, err = exec_file("./test.gpt", opts={"chdir": "./tests/fixtures"})
131133
for line in out:
132134
print(line)
133135
for line in err:
@@ -139,14 +141,14 @@ def test_exec_file_with_chdir():
139141

140142
# Test streaming execution from a file
141143
def test_stream_exec_file():
142-
out, err, wait = stream_exec_file("./fixtures/test.gpt")
144+
out, err, wait = stream_exec_file("./tests/fixtures/test.gpt")
143145
resp = wait() # Wait for streaming to complete
144146
for line in out:
145147
print(line)
146148
for line in err:
147149
print(line)
148150
assert (
149-
out is not None or err is not None
151+
out is not None or err is not None
150152
), "Expected some output or error from stream_exec_file"
151153
assert resp == 0, "Expected a successful response from stream_exec_file"
152154

@@ -166,7 +168,7 @@ def test_stream_exec_tool_with_events(simple_tool):
166168

167169

168170
def test_stream_exec_file_with_events():
169-
out, err, events, wait = stream_exec_file_with_events("./fixtures/test.gpt")
171+
out, err, events, wait = stream_exec_file_with_events("./tests/fixtures/test.gpt")
170172
has_events = False
171173
for line in events:
172174
has_events = line != ""

tests/tox.ini renamed to tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ envlist = py3
33

44
[testenv]
55
deps = pytest
6-
-e ../
6+
77
passenv = OPENAI_API_KEY, GPTSCRIPT_BIN
88
commands =
9-
install_gptscript
10-
pytest
9+
install_gptscript
10+
pytest tests/

0 commit comments

Comments
 (0)