Registry / testing / os-testr

os-testr

JSON →
library3.0.0pypypiunverified

os-testr is a Python library that acts as a wrapper for the `testr` (now often `stestr`) test runner, specifically providing additional functionality and integrations tailored for OpenStack projects. It enables features like `subunit-trace` for output filtering, `subunit2html` for HTML test reports, and `generate-subunit` for single test streams. The current version is 3.0.0, and its major release cadence is infrequent, typically aligning with broader OpenStack development cycles.

pip install os-testr
INSTALL
IMPORT
SIG · OS-TESTR
O
os-testr
testingpythonv3.0.0
Install
2.3s avg
Import
Disk
25MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 22.6MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.3s · import 0.000s · 24MB
25MB installed
● package 25MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CLI tool 'ostestr'
os-testr is primarily used as a command-line tool via 'ostestr'. Direct Python imports for end-user functionality are uncommon, as it wraps the testr/stestr runner.
Users typically interact with os-testr through its command-line interface, 'ostestr', rather than importing specific Python classes or functions into their own code.

os-testr is commonly invoked from the command line, often within `tox.ini` or project-specific `run_tests.sh` scripts in OpenStack environments. The primary executable is `ostestr`.

# To run all tests in an OpenStack project directory: ostestr # To run specific tests matching a regex pattern: ostestr --regex '(my_project.tests.unit.test_module.TestClass.test_method)' # To run tests in serial mode (default is parallel): ostestr --serial # To run tests with a specific number of parallel workers: ostestr --concurrency 4 # To skip tests listed in a blacklist file: ostestr -b /path/to/skip_tests.txt
os-testr --version
Debug
Known issues
gotchaWhen using `testr` (which `os-testr` wraps), encountering 'The test run didn't actually run any tests' often indicates an underlying import error or issue during the test listing phase. The wrapper itself isn't running tests, but listing them for the runner.
fix
Check your test paths, `PYTHONPATH`, and ensure all test dependencies are correctly installed and importable. Run a single, simple test to isolate import issues.
affects: All versions
gotchaDirect debugging with `pdb.set_trace()` within tests run by `ostestr` (or `testr`/`stestr`) may not work as expected due to how `testr` forks processes and captures output.
fix
For debugging, explicitly use `testtools.run` with a generated test list. First, generate a list of tests (e.g., using `testr list-tests > my-list`), then run `testtools.run my-list` with your `pdb.set_trace()` in place.
affects: All versions
Upgrade
Version history
3.0.0latest on PyPI · released Apr 4, 2022
Audit
Dependencies
testrepositoryrequiredCore underlying test runner that os-testr wraps, though modern OpenStack projects often use 'stestr'.
stestroptionalA newer, actively maintained fork of testrepository, often used interchangeably or preferred in recent OpenStack setups.
python-subunitrequiredUsed for generating and consuming subunit test streams.
python-testtoolsrequiredProvides extensions to unittest, used by testr/stestr.
Agent activity
10 hits · last 30 days
node
8
Amazon
1
Resources
os-testr — pip install os-testr · libregistry