Skip to content

Commit 3553cfb

Browse files
committed
Add Testing section to dev-docs
1 parent 4473a12 commit 3553cfb

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

docs/dev-docs.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,21 @@ Now link the plugin to your QGIS profile python:
2727
mklink /J <path-to-QGIS-user-folder>\QGIS3\profiles\default\python\plugins\Mergin <path-to-mergin-qgis-plugin>\Mergin
2828
```
2929

30+
### Running tests
31+
32+
Tests live in [`tests/`](../tests) and run via `pytest`. Because the suite depends on QGIS alongside Python testing tooling, conda is the most reliable way to assemble the whole stack. It also enables pinning a specific QGIS version, which is how CI tests across multiple releases. The repo ships an [`environment.yml`](../environment.yml) for it.
33+
34+
1. Install [Miniconda](https://docs.anaconda.com/miniconda/) if you don't have it yet.
35+
2. Create the test environment :
36+
```
37+
conda env create -f environment.yml
38+
```
39+
3. Activate it and run the suite from the repo root:
40+
```
41+
conda activate qgis-test-env
42+
pytest ./tests --cov=Mergin
43+
```
44+
3045
## Debugging (VS Code)
3146

3247
1. Install the `python3-debugpy` package. QGIS DevTools relies on `debugpy` being available in QGIS's bundled Python.

0 commit comments

Comments
 (0)