You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45-21Lines changed: 45 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@
12
12
13
13
## 🎧 Quick Start
14
14
15
-
Ensure [Python](https://www.python.org/downloads) and [Python Poetry](https://python-poetry.org/docs/#installation) are installed.
15
+
Ensure [Python](https://www.python.org/downloads), [Python Poetry](https://python-poetry.org/docs/#installation), and [Poe the Poet](https://poethepoet.natn.io/installation.html) are installed.
16
16
17
17
Dependency installation is managed via `poetry`. Once cloned, you can install dependencies from the project root:
18
18
@@ -28,26 +28,6 @@ poetry run package-name
28
28
29
29
And boom! You're ready to customize a Python project! 🎉
30
30
31
-
## 🧪 Running Tests
32
-
33
-
[`pytest`](https://docs.pytest.org/en/7.4.x/) is used as a test runner and its configuration can be found in the `tool.pytest.ini_options` section of [pyproject.toml](./pyproject.toml). [`pytest-cov`](https://pytest-cov.readthedocs.io/en/latest/index.html) is used as a coverage reporter.
34
-
35
-
Running `pytest` with no arguments will:
36
-
37
-
- Automatically add `src` to `PYTHONPATH` (pythonpath: `src`)
38
-
- Only run unit tests (testpaths: `tests/unit/package_name`)
39
-
- Increase verbosity (`-vv`)
40
-
- Calculate coverage (using `pytest-cov`) and display any modules missing coverage
41
-
42
-
You can specify different paths to run different groupings of tests:
43
-
44
-
```shell
45
-
pytest tests/unit # Run unit tests
46
-
pytest tests/integration # Run integration tests
47
-
pytest tests/e2e # Run end-to-end tests
48
-
pytest tests # Run all tests
49
-
```
50
-
51
31
## Configuring Developer Standards
52
32
53
33
Use `git` to install commit message, pre-commit, and pre-push commit hooks:
@@ -61,6 +41,50 @@ These will ensure commit messages are consistent, code is correctly formatted an
61
41
62
42
Style decisions are based on the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html).
63
43
44
+
## 🧑🏽💻 Running Project Tasks
45
+
46
+
[`poe`](https://poethepoet.natn.io/index.html) is used as a task runner and its configuration can be found in the `tool.poe.tasks*` sections of [pyproject.toml](./pyproject.toml).
|`poe test`| Run application test suites that support coverage |`PYTHONPATH=src poetry run pytest -vv --import-mode=importlib --cov=src/package_name --cov-fail-under=90 --cov=src/package_name --cov-branch --cov-report term-missing:skip-covered tests/unit tests/integration`|
51
+
|`poe test-all`| Run all tests (without coverage) |`PYTHONPATH=src pytest -vv --import-mode=importlib`|
52
+
|`poe test-e2e`| Run e2e tests only |`PYTHONPATH=src poetry run pytest -vv --import-mode=importlib tests/e2e`|
53
+
|`poe test-integration`| Run integration tests only (with coverage) |`PYTHONPATH=src poetry run pytest -vv --import-mode=importlib --cov=src/package_name --cov-fail-under=90 --cov=src/package_name --cov-branch --cov-report term-missing:skip-covered tests/integration`|
54
+
|`poe test-unit`| Run unit tests only (without coverage) |`PYTHONPATH=src poetry run pytest -vv --import-mode=importlib tests/unit`|
55
+
|`poe check`| Run all formatting and linting tools against codebase |`poetry run black --check --line-length 100 . && npx --yes prettier@3.0.3 . --no-config --check && poetry run pylint src tests`|
56
+
|`poe format`| Run all formatting tools against codebase |`poetry run black --check --line-length 100 . && npx --yes prettier@3.0.3 . --no-config --check`|
57
+
|`poe format-black`| Run black against Python source code |`poetry run black --check --line-length 100 .`|
58
+
|`poe format-prettier`| Run prettier against non-Python code |`npx --yes prettier@3.0.3 . --no-config --check`|
59
+
|`poe lint`| Run all linting tools against codebase |`poetry run pylint src tests`|
60
+
|`poe lint-pylint`| Lint Python source code and tests with pylint |`poetry run pylint src tests`|
61
+
62
+
## 🧪 Testing Configuration
63
+
64
+
[`pytest`](https://docs.pytest.org/en/7.4.x/) is used as a test runner and its configuration can be found in the `tool.pytest.ini_options` section of [pyproject.toml](./pyproject.toml). [`pytest-cov`](https://pytest-cov.readthedocs.io/en/latest/index.html) is used as a coverage reporter.
65
+
66
+
Running `pytest` with no arguments will:
67
+
68
+
- Automatically add `src` to the `PYTHONPATH` (pythonpath: `src`)
69
+
- Increase verbosity (`-vv`)
70
+
- Override pytest's historical default import mode to `importlib` which is recommended for new projects (`--import-mode=importlib`)
71
+
- Run all available test items in [`./tests/`](./tests)
72
+
73
+
Tests are grouped into suites using different path names:
0 commit comments