File: test_insert.py

package info (click to toggle)
sqlitedict 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 200 kB
  • sloc: python: 825; makefile: 31; sh: 7
file content (15 lines) | stat: -rw-r--r-- 288 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import tempfile

from sqlitedict import SqliteDict


def insert():
    with tempfile.NamedTemporaryFile() as tmp:
        for j in range(100):
            with SqliteDict(tmp.name) as d:
                d["tmp"] = j
                d.commit()


def test(benchmark):
    benchmark(insert)