pytest-case-start-from
A pytest plugin that allows you to start test execution from a specific test case, skipping all tests before it.
Features
- ✅ Start test execution from any test case using
--start-fromor-sfoption - ✅ Pattern matching similar to pytest's
-koption - ✅ Support for substring matching
- ✅ Support for logical operators:
and,or,not - ✅ Works with test functions, test methods, and test classes
- ✅ Easy to install and use
Installation
Development mode (for local testing)
pip install -e .
Regular installation
pip install .
Quick Start
# skip all tests before test_third
pytest --start-from test_third
# pattern matching with substring
pytest --start-from "third"
# match test in a class
pytest --start-from "TestClass::test_method"
Usage Examples
Basic Usage
# start from a specific test
pytest --start-from test_fourth test_example.py
# use with verbose output
pytest --start-from test_second -v
# combine with other pytest options
pytest --start-from test_third -v -s --tb=short
Pattern Matching
# substring match
pytest --start-from "class_second"
# logical operators
pytest --start-from "parameters and a"
pytest --start-from "first or second"
pytest --start-from "test not class"
How It Works
- The plugin hooks into pytest's test execution flow
- Before each test runs, it checks if the test name matches the specified pattern
- All tests before the first match are marked as SKIPPED
- Once the first matching test is found, all subsequent tests run normally
Documentation
For detailed usage instructions, see USAGE.md
Use Cases
- Debugging: Skip passing tests and start from the failing test
- Incremental Testing: Continue from where tests were interrupted
- Development: Focus on specific tests during feature development
- CI/CD Optimization: Resume test execution from a specific point
Requirements
- Python >= 3.7
- pytest >= 6.0.0
License
MIT License - see LICENSE file for details
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
Metadata
Release files for pytest-case-start-from 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest_case_start_from-1.0.0.tar.gz | 12.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_case_start_from-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.7 kB
Release files / pytest_case_start_from-1.0.0.tar.gz
| Download URL | pytest_case_start_from-1.0.0.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a300a0098d550365109d6ed2af848161601d192d39407c48c7ee1eca83b2990b
|
|
BLAKE2b-256 checksum How to use checksums |
827cf25b96fd702de080362f995059107f2166040039fdf0afd7248f00e68af1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / pytest_case_start_from-1.0.0-py3-none-any.whl
| Download URL | pytest_case_start_from-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fefccf53f8e668275a2475152c73220a2c86c62da5b623f6bd640825d0bbfa0a
|
|
BLAKE2b-256 checksum How to use checksums |
054c005c826ccfae0e70aa3fc94dfb73e9e3470a693d5a0fef29c5f57f177951
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|