Simon Willison’s Weblog

Subscribe

Items tagged pytest in Feb, 2022

Filters: Year: 2022 × Month: Feb × pytest × Sorted by date


Running C unit tests with pytest (via) Brilliant, detailed tutorial by Gabriele Tornetta on testing C code using pytest, which also doubles up as a ctypes tutorial. There’s a lot of depth here—in addition to exercising C code through ctypes, Gabriele shows how to run each test in a separate process so that segmentation faults don’t fail the entire suite, then adds code to run the compiler as part of the pytest run, and then shows how to use gdb trickery to generate more useful stack traces. # 12th February 2022, 5:14 pm

Types

Years

Months

Tags