Skip to content

Commit 08b20d0

Browse files
committed
Tell users to run test setup commands from src/products/test to avoid prefix in README
1 parent 104aeaa commit 08b20d0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/products/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ Returns details on all categories.
4242
Returns details on the category identified by `{categoryID}`.
4343

4444
## Testing
45-
To run integration tests for the Products service a Python virtual environment is required. You must have Python 3.8+ installed on your system to run the commands below. The commands are written to be ran from the project root.
45+
To run integration tests for the Products service a Python virtual environment is required. You must have Python 3.8+ installed on your system to run the commands below. The commands are written to be ran from the test directory of the products service (`src/products/test`).
4646

47-
The following command will create a virtual environment in the test directory of the products service.
47+
The following command will create a virtual environment.
4848
```console
49-
python3 -m venv src/products/test/.venv
49+
python3 -m venv .venv
5050
```
5151

5252
Some environment variables are required to run the tests and need to be added to the virtual environment. The example below will work for local development. Change as required depending on environment.
@@ -55,22 +55,22 @@ echo '
5555
export PRODUCTS_API_URL="http://localhost:8001"
5656
export TEST_PRODUCT_ID="8bffb5fb-624f-48a8-a99f-b8e9c64bbe29"
5757
export TEST_CATEGORY_NAME="tools"
58-
export TEST_CATEGORY_ID="16"' >> src/products/test/.venv/bin/activate
58+
export TEST_CATEGORY_ID="16"' >> .venv/bin/activate
5959
```
6060

6161
To activate and enter the virtual environment.
6262
```console
63-
source src/products/test/.venv/bin/activate
63+
source .venv/bin/activate
6464
```
6565

6666
To install requirements for the integration tests.
6767
```console
68-
pip install -r src/products/test/integ/requirements.txt
68+
pip install -r integ/requirements.txt
6969
```
7070

7171
To run the tests.
7272
```console
73-
pytest src/products/test/integ/test-products.py
73+
pytest integ/test-products.py
7474
```
7575

7676
You can exit the virtual environment with `deactivate`.

0 commit comments

Comments
 (0)