Skip to content

Commit

Permalink
Test for 3.11 and 3.12 insert and delete, refs #2
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Mar 5, 2024
1 parent 6d9d877 commit d4c8c54
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
Expand All @@ -31,11 +31,11 @@ jobs:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
Expand Down
15 changes: 14 additions & 1 deletion tests/test_sqlite_debug_authorizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


@pytest.mark.asyncio
async def test_plugin_is_installed(capsys):
async def test_select(capsys):
datasette = Datasette(memory=True)
response = await datasette.client.get("/_memory.json?sql=select+1")
assert response.status_code == 200
Expand All @@ -15,3 +15,16 @@ async def test_plugin_is_installed(capsys):
"SQLITE_PRAGMA:",
):
assert expected in captured


@pytest.mark.asyncio
async def test_insert_delete(capsys):
# https://github.com/datasette/datasette-sqlite-debug-authorizer/issues/2
datasette = Datasette()
db = datasette.add_memory_database("test_insert_delete")
await db.execute_write("create table foo (name text)")
await db.execute_write("insert into foo (name) values ('bar')")
await db.execute_write("delete from foo where name='bar'")
captured = capsys.readouterr().err
assert 'SQLITE_INSERT: table="foo" db_name=main' in captured
assert 'SQLITE_DELETE: table="foo" db_name=main' in captured

0 comments on commit d4c8c54

Please sign in to comment.