pgtap
Unit testing for PostgreSQL
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pgtap | 1.3.4 | LANG | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 3200 | pgtap | No | Yes | No | Yes | No | No | - |
missing pg17 el9, breaking perl deps
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PGDG | 1.3.4 | 1817161514 | pgtap | plpgsql |
| RPM | PGDG | 1.3.4 | 1817161514 | pgtap_$v | - |
| DEB | PGDG | 1.3.4 | 1817161514 | postgresql-$v-pgtap | - |
Install
You can install pgtap directly. First, make sure the PGDG repository is added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
Usage
pgtap is a unit testing framework for PostgreSQL that produces TAP (Test Anything Protocol) output, providing hundreds of assertion functions for testing database objects and query results.
Test Structure
Use no_plan() when the test count is not known in advance:
Basic Assertions
Schema Testing
Error Testing
Query Result Testing
Running Tests with pg_prove
xUnit Style
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)