Async fixtures with pytest-asyncio
I wanted to use a fixture with `pytest-asyncio` that was itsef as `async def` function, so that it could execute `await` statements.
127 words
|
1 minute
Writing tests for the Django admin with pytest-django
I'm using [pytest-django](https://pytest-django.readthedocs.io/) on a project and I wanted to write a test for a Django admin create form submissio...
194 words
|
1 minute
Using curl to run GraphQL queries from the command line
I wanted to run a query against the GitHub GraphQL API using `curl` on the command line, while keeping the query itself as readable as possible. He...
751 words
|
4 minutes
Redirecting a whole domain with Cloudflare
I had to run this site on `til.simonwillison.org` for 24 hours due to a domain registration mistake I made.
148 words
|
1 minute
Closest locations to a point
Here's a PostgreSQL SQL query that returns the closest locations to a point, based on a brute-force approach where the database calculates the dist...
234 words
|
1 minute
Installing flash-attn without compiling it
If you ever run into instructions that tell you to do this:
280 words
|
1 minute
Tracking SQLite table history using a JSON audit log
I continue to collect ways of tracking the history of a table of data stored in SQLite - see [sqlite-history](https://simonwillison.net/2023/Apr/15...
1187 words
|
6 minutes
Use setup.py to install platform-specific dependencies
For [photos-to-sqlite](https://github.com/dogsheep/photos-to-sqlite) I needed to install `osxphotos` as a dependency, but only if the platform is m...
55 words
|
1 minute