SuiteAs
An opinionated testing suite organizer and linter for pytest.
SuiteAs will automatically generate a skeletonized unit test suite based on the structure of your project. Then, going forward, it will enforce matching names and folder structure between your testing suite and your project using linter rules.
For now, only linting is supported; automatic test suite generation will be added later.
Sweet As
INFORMAL • NEW ZEALAND
very satisfactory; excellent.
The recommended way to use SuiteAs is using the pre-commit framework. Add the following to your .pre-commit-config.yaml file:
- repo: https://github.com/nathanjmcdougall/suiteas
rev: v0.3.1
hooks:
- id: suiteas
You can also install and run SuiteAs as a standalone package:
pip install suiteas
python -m suiteas .
SuiteAs will try to automatically determine your project directory structure and
configuration, but you can manually configure SuiteAs in a pyproject.toml file.
For example, if your project looks like this:
.
└── myrepo/
├── src/
│ ├── mypkg/
│ └── otherpkg/
├── tests/
│ ├── unit/
│ │ ├── mypkg/
│ │ └── otherpkg/
│ └── endtoend/
└── pyproject.toml
Then you would add this section to pyproject.toml:
[tool.suiteas]
pkg_names = ["mypkg", "otherpkg"]
src_rel_path = "src"
tests_rel_path = "tests"
unittest_dir_name = "unit"
ignore = ["SUI002"]
The final line will globally disable the linting of the SUI002 rule.
Rules
SuiteAs will enforce the following rules:
| Rule | Description |
|---|---|
| SUI001 | Function or class is missing a corresponding test function |
| SUI002 | Pytest test class is empty |
| SUI003 | Pytest file does not import the function being tested |
Developer Information
Package Management
This project uses rye to manage dependencies, virtual environments, and the python installation. Run rye sync from the project root to install the development environment.
Hooks with pre-commit
This project uses pre-commit to manage hooks. After installing the development environment, run pre-commit install.
Signed Commits
This project requires signed commits. Please see this guide from the VS Code project for instructions on how to configure this.
Diagramming
This project uses D2Lang to develop and maintain design diagrams.
Changelog
This project uses towncrier to manage the changelog. Each PR should have at least one associated GitHub issue. Before the PR is merged, a changelog entry should be created for any issues which are resolved by the PR. The changelog entry files are created in the doc/changelog_entries directory, with the filename following the convention <github id>.<type>.rst where <github id> is the GitHub issue ID number, and <type> is one of the types documented in the pyproject.toml file in the [tool.towncrier.type] sections.
Metadata
Release files for suiteas 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| suiteas-0.3.3.tar.gz | 33.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| suiteas-0.3.3-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 50.6 kB
Release files / suiteas-0.3.3.tar.gz
| Download URL | suiteas-0.3.3.tar.gz |
|---|---|
| Size | 33.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d132135f4ac7529f0746b60afce313fd20918f5ec7f27f6864d3d1a37174b14c
|
|
BLAKE2b-256 checksum How to use checksums |
8b6909b598d11ce9ffb95097a70b933ba482442deba4a68b662830955cf1a1cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.3
|
Release files / suiteas-0.3.3-py2.py3-none-any.whl
| Download URL | suiteas-0.3.3-py2.py3-none-any.whl |
|---|---|
| Size | 17.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
e8a5ec94539418f2dec154a83d38a11d80e4c9dd1865219bd3c8cb39c3c16123
|
|
BLAKE2b-256 checksum How to use checksums |
c676736b5a8d313ef44ed30192e7d74db615776ef0dbc7d18dc9924a8eae85c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.3
|