tests/README.md

Tests

Overview

The package uses the testthat framework for unit testing and as a test runner. Any contribution to the code of the package must include tests that conform to the style of existing testing.

Coverage

Complete and high test coverage is a priority and goal in the package to ensure a stable and reliable user experience. We use covr for computing and tracking test coverage. covr results are uploaded to codecov and automatic through github actions, see https://github.com/openaq/openaq-r/blob/main/.github/workflows/test-coverage.yaml.

Mocking

Fixtures

YAML test fixures are generated using vcr and based off a local deployment of the OpenAQ database and OpenAQ API instead of the live hosted instance. This is to provide a reproduceable and predictable test cases.

JSON test fixtures are generated by JSON schema faker based on JSON schemas derived from the OpenAQ API Pydantic models.



Try the openaq package in your browser

Any scripts or data that you put into this service are public.

openaq documentation built on March 19, 2026, 5:08 p.m.