mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Added a unit test for the sql_time_limit_ms option. To test this, I needed to add a custom SQLite sleep() function. I've added a simple mechanism to the Datasette class for registering custom functions. I also had to modify the sqlite_timelimit() function. It makes use of a magic value, N, which is the number of SQLite virtual machine instructions that should execute in between calls to my termination decision function. The value of N was not finely grained enough for my test to work - so I've added logic that says that if the time limit is less than 50ms, N is set to 1. This got the tests working. Refs #95 |
||
|---|---|---|
| .. | ||
| test_app.py | ||
| test_utils.py | ||