Skip to content

Commit 143a4db

Browse files
authored
[skip changelog] Consolidate integration test instructions (#972)
Previously, instructions for running integration tests were present both in CONTRIBUTING.md as well as in test/README.md. Although most of the content was duplicated, there was some important unique content on each page and the readers of one document would not necessarily know of the existence of relevant information in the other. Duplicate content is more work to maintain, and likely to end up becoming outdated. So I have transfered the unique content from test/README.md to CONTRIBUTING.md and replaced it with a link to that content.
1 parent 900654f commit 143a4db

File tree

2 files changed

+26
-64
lines changed

2 files changed

+26
-64
lines changed

docs/CONTRIBUTING.md

+25-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ pip3 install --user poetry
129129

130130
For more installation options read the [official documentation][poetry-docs].
131131

132-
After Poetry has been installed you should be able to run the tests with:
132+
#### Running tests
133+
134+
After the software requirements have been installed you should be able to run the tests with:
133135

134136
```shell
135137
task test-integration
@@ -138,6 +140,28 @@ task test-integration
138140
This will automatically install the necessary dependencies, if not already installed, and run the integration tests
139141
automatically.
140142

143+
To run specific modules you must run `pytest` from the virtual environment created by Poetry.
144+
145+
```shell
146+
poetry run pytest test/test_lib.py
147+
```
148+
149+
To run very specific test functions:
150+
151+
```shell
152+
poetry run pytest test/test_lib.py::test_list
153+
```
154+
155+
You can avoid writing the `poetry run` prefix each time by creating a new shell inside the virtual environment:
156+
157+
```shell
158+
poetry shell
159+
pytest test_lib.py
160+
pytest test_lib.py::test_list
161+
```
162+
163+
#### Linting and formatting
164+
141165
When editing any Python file in the project remember to run linting checks with:
142166

143167
```shell

test/README.md

+1-63
Original file line numberDiff line numberDiff line change
@@ -3,66 +3,4 @@
33
This dir contains integration tests, aimed to test the Command Line Interface and its output from a pure user point of
44
view.
55

6-
## Installation
7-
8-
See also [Contributing][0].
9-
10-
To run the integration tests you must install [Poetry][poetry-website].
11-
12-
```shell
13-
pip3 install --user poetry
14-
```
15-
16-
For more installation options read the [official documentation][poetry-docs].
17-
18-
## Running tests
19-
20-
To run all the tests from the project's root folder:
21-
22-
```shell
23-
task test-integration
24-
```
25-
26-
This will create and install all necessary dependencies if not already existing and then run integrations tests.
27-
28-
To run specific modules you must run `pytest` from the virtual environment created by Poetry. If dependencies have not
29-
already been installed first run `poetry install`.
30-
31-
```shell
32-
poetry run pytest test/test_lib.py
33-
```
34-
35-
To run very specific test functions:
36-
37-
```shell
38-
poetry run pytest test/test_lib.py::test_list
39-
```
40-
41-
You can avoid writing the `poetry run` prefix each time by creating a new shell inside the virtual environment:
42-
43-
```shell
44-
poetry shell
45-
pytest test_lib.py
46-
pytest test_lib.py::test_list
47-
```
48-
49-
## Linting and formatting
50-
51-
To run lint check from the project's root folder:
52-
53-
```shell
54-
task python:check
55-
```
56-
57-
This will run `flake8` automatically and return any error in the code formatting, if not already installed it will also
58-
install integration tests dependencies.
59-
60-
In case of linting errors you should be able to solve most of them by automatically formatting with:
61-
62-
```shell
63-
task python:format
64-
```
65-
66-
[0]: ../docs/CONTRIBUTING.md
67-
[poetry-website]: https://python-poetry.org/
68-
[poetry-docs]: https://python-poetry.org/docs/
6+
For instructions, see the [contributing guide](../docs/CONTRIBUTING.md/#integration-tests).

0 commit comments

Comments
 (0)