Skip to content

Commit 0fc9a4f

Browse files
fix docs: function-template-python changed the way of testing and docs is broken now
1 parent 7b445dc commit 0fc9a4f

File tree

5 files changed

+61
-34
lines changed

5 files changed

+61
-34
lines changed

content/master/guides/write-a-composition-function-in-python.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -451,21 +451,26 @@ if __name__ == "__main__":
451451
```
452452
{{</expand>}}
453453

454-
Run the unit tests using `hatch run`:
454+
Run the unit tests using `hatch test`:
455455

456456
```shell {copy-lines="1"}
457-
hatch run test:unit
458-
.
459-
----------------------------------------------------------------------
460-
Ran 1 test in 0.003s
457+
❯ hatch test
458+
================================== test session starts ==================================
459+
platform darwin -- Python 3.12.8, pytest-8.3.5, pluggy-1.5.0
460+
rootdir: ./function-template-python
461+
configfile: pyproject.toml
462+
plugins: rerunfailures-14.0, mock-3.14.0, xdist-3.6.1
463+
collected 1 item
461464
462-
OK
465+
tests/test_fn.py . [100%]
466+
467+
=================================== 1 passed in 0.26s ===================================
463468
```
464469

465470
{{<hint "tip">}}
466471
[Hatch](https://hatch.pypa.io/) is a Python build tool. It builds Python
467472
artifacts like wheels. It also manages virtual environments, similar
468-
to `virtualenv` or `venv`. The `hatch run` command creates a virtual environment
473+
to `virtualenv` or `venv`. The `hatch test` command creates a virtual environment
469474
and runs a command in that environment.
470475
{{</hint>}}
471476

content/v1.17/guides/write-a-composition-function-in-python.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -451,21 +451,26 @@ if __name__ == "__main__":
451451
```
452452
{{</expand>}}
453453

454-
Run the unit tests using `hatch run`:
454+
Run the unit tests using `hatch test`:
455455

456456
```shell {copy-lines="1"}
457-
hatch run test:unit
458-
.
459-
----------------------------------------------------------------------
460-
Ran 1 test in 0.003s
457+
❯ hatch test
458+
================================== test session starts ==================================
459+
platform darwin -- Python 3.12.8, pytest-8.3.5, pluggy-1.5.0
460+
rootdir: ./function-template-python
461+
configfile: pyproject.toml
462+
plugins: rerunfailures-14.0, mock-3.14.0, xdist-3.6.1
463+
collected 1 item
461464
462-
OK
465+
tests/test_fn.py . [100%]
466+
467+
=================================== 1 passed in 0.26s ===================================
463468
```
464469

465470
{{<hint "tip">}}
466471
[Hatch](https://hatch.pypa.io/) is a Python build tool. It builds Python
467472
artifacts like wheels. It also manages virtual environments, similar
468-
to `virtualenv` or `venv`. The `hatch run` command creates a virtual environment
473+
to `virtualenv` or `venv`. The `hatch test` command creates a virtual environment
469474
and runs a command in that environment.
470475
{{</hint>}}
471476

content/v1.18/guides/write-a-composition-function-in-python.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -453,19 +453,26 @@ if __name__ == "__main__":
453453

454454
Run the unit tests using `hatch run`:
455455

456+
Run the unit tests using `hatch test`:
457+
456458
```shell {copy-lines="1"}
457-
hatch run test:unit
458-
.
459-
----------------------------------------------------------------------
460-
Ran 1 test in 0.003s
459+
❯ hatch test
460+
================================== test session starts ==================================
461+
platform darwin -- Python 3.12.8, pytest-8.3.5, pluggy-1.5.0
462+
rootdir: ./function-template-python
463+
configfile: pyproject.toml
464+
plugins: rerunfailures-14.0, mock-3.14.0, xdist-3.6.1
465+
collected 1 item
466+
467+
tests/test_fn.py . [100%]
461468
462-
OK
469+
=================================== 1 passed in 0.26s ===================================
463470
```
464471

465472
{{<hint "tip">}}
466473
[Hatch](https://hatch.pypa.io/) is a Python build tool. It builds Python
467474
artifacts like wheels. It also manages virtual environments, similar
468-
to `virtualenv` or `venv`. The `hatch run` command creates a virtual environment
475+
to `virtualenv` or `venv`. The `hatch test` command creates a virtual environment
469476
and runs a command in that environment.
470477
{{</hint>}}
471478

content/v1.19/guides/write-a-composition-function-in-python.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -451,21 +451,26 @@ if __name__ == "__main__":
451451
```
452452
{{</expand>}}
453453

454-
Run the unit tests using `hatch run`:
454+
Run the unit tests using `hatch test`:
455455

456456
```shell {copy-lines="1"}
457-
hatch run test:unit
458-
.
459-
----------------------------------------------------------------------
460-
Ran 1 test in 0.003s
457+
❯ hatch test
458+
================================== test session starts ==================================
459+
platform darwin -- Python 3.12.8, pytest-8.3.5, pluggy-1.5.0
460+
rootdir: ./function-template-python
461+
configfile: pyproject.toml
462+
plugins: rerunfailures-14.0, mock-3.14.0, xdist-3.6.1
463+
collected 1 item
461464
462-
OK
465+
tests/test_fn.py . [100%]
466+
467+
=================================== 1 passed in 0.26s ===================================
463468
```
464469

465470
{{<hint "tip">}}
466471
[Hatch](https://hatch.pypa.io/) is a Python build tool. It builds Python
467472
artifacts like wheels. It also manages virtual environments, similar
468-
to `virtualenv` or `venv`. The `hatch run` command creates a virtual environment
473+
to `virtualenv` or `venv`. The `hatch test` command creates a virtual environment
469474
and runs a command in that environment.
470475
{{</hint>}}
471476

content/v2.0-preview/guides/write-a-composition-function-in-python.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -451,21 +451,26 @@ if __name__ == "__main__":
451451
```
452452
{{</expand>}}
453453

454-
Run the unit tests using `hatch run`:
454+
Run the unit tests using `hatch test`:
455455

456456
```shell {copy-lines="1"}
457-
hatch run test:unit
458-
.
459-
----------------------------------------------------------------------
460-
Ran 1 test in 0.003s
457+
❯ hatch test
458+
================================== test session starts ==================================
459+
platform darwin -- Python 3.12.8, pytest-8.3.5, pluggy-1.5.0
460+
rootdir: ./function-template-python
461+
configfile: pyproject.toml
462+
plugins: rerunfailures-14.0, mock-3.14.0, xdist-3.6.1
463+
collected 1 item
461464
462-
OK
465+
tests/test_fn.py . [100%]
466+
467+
=================================== 1 passed in 0.26s ===================================
463468
```
464469

465470
{{<hint "tip">}}
466471
[Hatch](https://hatch.pypa.io/) is a Python build tool. It builds Python
467472
artifacts like wheels. It also manages virtual environments, similar
468-
to `virtualenv` or `venv`. The `hatch run` command creates a virtual environment
473+
to `virtualenv` or `venv`. The `hatch test` command creates a virtual environment
469474
and runs a command in that environment.
470475
{{</hint>}}
471476

0 commit comments

Comments
 (0)