Skip to content

Commit

Permalink
Don't depend on exact syntax errors in tests (#451)
Browse files Browse the repository at this point in the history
We have tests for syntax errors in the server, we're just testing the
binding/protocol flow here. (And other places test that messages come
through more generally.)
  • Loading branch information
msullivan committed Aug 9, 2023
1 parent 3bfb574 commit b3ce0c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
PIP_DISABLE_PIP_VERSION_CHECK: 1

strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
edgedb-version: [stable , nightly]
Expand Down
12 changes: 3 additions & 9 deletions tests/test_async_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,10 @@ async def test_async_parse_error_recover_01(self):
with self.assertRaises(edgedb.EdgeQLSyntaxError):
await self.client.query('select syntax error')

with self.assertRaisesRegex(
edgedb.EdgeQLSyntaxError,
r"(Unexpected end of line)|(Missing '\)')"
):
with self.assertRaises(edgedb.EdgeQLSyntaxError):
await self.client.query('select (')

with self.assertRaisesRegex(
edgedb.EdgeQLSyntaxError,
r"(Unexpected end of line)|(Missing '\)')"
):
with self.assertRaises(edgedb.EdgeQLSyntaxError):
await self.client.query_json('select (')

for _ in range(10):
Expand Down Expand Up @@ -854,7 +848,7 @@ async def exec_to_fail():

g.create_task(exec_to_fail())

await asyncio.wait_for(fut, 1)
await asyncio.wait_for(fut, 5)
await asyncio.sleep(0.1)

with self.assertRaises(asyncio.TimeoutError):
Expand Down
10 changes: 2 additions & 8 deletions tests/test_sync_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,10 @@ def test_sync_parse_error_recover_01(self):
with self.assertRaises(edgedb.EdgeQLSyntaxError):
self.client.query('select syntax error')

with self.assertRaisesRegex(
edgedb.EdgeQLSyntaxError,
r"(Unexpected end of line)|(Missing '\)')"
):
with self.assertRaises(edgedb.EdgeQLSyntaxError):
self.client.query('select (')

with self.assertRaisesRegex(
edgedb.EdgeQLSyntaxError,
r"(Unexpected end of line)|(Missing '\)')"
):
with self.assertRaises(edgedb.EdgeQLSyntaxError):
self.client.query_json('select (')

for _ in range(10):
Expand Down

0 comments on commit b3ce0c6

Please sign in to comment.