Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't depend on exact syntax errors in tests #451

Merged
merged 2 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -62,16 +62,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 @@ -855,7 +849,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