Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Add missing close in tests; Update test syntax

Tomas Valentae472ef0843f6
diff --git a/packages/js-sdk/test/filesystem.test.mjs b/packages/js-sdk/test/filesystem.test.mjs
index 91fecc169..9c16f70c3 100644
--- a/packages/js-sdk/test/filesystem.test.mjs
+++ b/packages/js-sdk/test/filesystem.test.mjs
@@ -58,8 +58,7 @@ test('list delete files', async () => {
})
test('watch dir', async () => {
- const session = new Session({ id })
- await session.open()
+ const session = await Session.create({ id })
await session.filesystem.write('/tmp/test.txt', 'Hello')
const watcher = session.filesystem.watchDir('/tmp')
diff --git a/packages/python-sdk/tests/test_timeout.py b/packages/python-sdk/tests/test_timeout.py
index 76902567a..d5418231c 100644
--- a/packages/python-sdk/tests/test_timeout.py
+++ b/packages/python-sdk/tests/test_timeout.py
@@ -5,8 +5,13 @@ from e2b.session.exception import TimeoutException
def test_create_session_timeout():
+ session: Session | None = None
+
with pytest.raises(TimeoutException):
- Session("Bash", timeout=0.01)
+ session = Session("Bash", timeout=0.01)
+
+ if session:
+ session.close()
def test_process_timeout():