Skip to content

Commit 8a507dc

Browse files
authored
Python: Added verbose test flag for pytest (valkey-io#3214)
added verbose flag for better pytest output Signed-off-by: Edward Liang <edward.liang@improving.com>
1 parent 7f386f0 commit 8a507dc

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

.github/workflows/python.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ jobs:
117117
source .env/bin/activate
118118
pip install -r dev_requirements.txt
119119
cd python/tests/
120-
pytest --asyncio-mode=auto --html=pytest_report.html --self-contained-html
120+
pytest -v --asyncio-mode=auto --html=pytest_report.html --self-contained-html
121121
122122
- uses: ./.github/workflows/test-benchmark
123123
if: ${{ matrix.engine.version == '8.0' && matrix.host.OS == 'ubuntu' && matrix.host.RUNNER == 'ubuntu-latest' && matrix.python == '3.12' }}
@@ -180,7 +180,7 @@ jobs:
180180
source .env/bin/activate
181181
pip install -r dev_requirements.txt
182182
cd python/tests/
183-
pytest --asyncio-mode=auto -k test_pubsub --html=pytest_report.html --self-contained-html
183+
pytest -v --asyncio-mode=auto -k test_pubsub --html=pytest_report.html --self-contained-html
184184
185185
- name: Upload test reports
186186
if: always()
@@ -286,7 +286,7 @@ jobs:
286286
run: |
287287
source .env/bin/activate
288288
cd python/tests/
289-
pytest --asyncio-mode=auto --html=pytest_report.html --self-contained-html
289+
pytest -v --asyncio-mode=auto --html=pytest_report.html --self-contained-html
290290
291291
- name: Upload test reports
292292
if: always()
@@ -326,7 +326,7 @@ jobs:
326326
run: |
327327
source .env/bin/activate
328328
cd python/tests/
329-
pytest --asyncio-mode=auto --tls --cluster-endpoints=${{ secrets.MEMDB_MODULES_ENDPOINT }} -k server_modules --html=pytest_report.html --self-contained-html
329+
pytest -v --asyncio-mode=auto --tls --cluster-endpoints=${{ secrets.MEMDB_MODULES_ENDPOINT }} -k server_modules --html=pytest_report.html --self-contained-html
330330
331331
- name: Upload test reports
332332
if: always()

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ python-lint: .build/python_deps
4848
--extend-ignore=E230
4949

5050
python-test: .build/python_deps check-redis-server
51-
cd python && PYTHONPATH=$(PY_PATH):$(PY_GLIDE_PATH) .env/bin/pytest --asyncio-mode=auto
51+
cd python && PYTHONPATH=$(PY_PATH):$(PY_GLIDE_PATH) .env/bin/pytest -v --asyncio-mode=auto
5252

5353
.build/python_deps:
5454
@echo "$(GREEN)Generating protobuf files...$(RESET)"

python/DEVELOPER.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ From a terminal, change directory to the GLIDE source folder and type:
133133
cd $HOME/src/valkey-glide
134134
cd python
135135
source .env/bin/activate
136-
pytest --asyncio-mode=auto
136+
pytest -v --asyncio-mode=auto
137137
```
138138

139139
To run modules tests:
@@ -142,15 +142,15 @@ To run modules tests:
142142
cd $HOME/src/valkey-glide
143143
cd python
144144
source .env/bin/activate
145-
pytest --asyncio-mode=auto -k "test_server_modules.py"
145+
pytest -v --asyncio-mode=auto -k "test_server_modules.py"
146146
```
147147

148148
**TIP:** to run a specific test, append `-k <test_name>` to the `pytest` execution line
149149

150150
To run tests against an already running servers, change the `pytest` line above to this:
151151

152152
```bash
153-
pytest --asyncio-mode=auto --cluster-endpoints=localhost:7000 --standalone-endpoints=localhost:6379
153+
pytest -v --asyncio-mode=auto --cluster-endpoints=localhost:7000 --standalone-endpoints=localhost:6379
154154
```
155155

156156
# Generate protobuf files

python/python/tests/conftest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def pytest_addoption(parser):
6565
help="""Load additional Valkey modules (provide full path for the module's shared library).
6666
Use multiple times for multiple modules.
6767
Example:
68-
pytest --load-module=/path/to/module1.so --load-module=/path/to/module2.so""",
68+
pytest -v --load-module=/path/to/module1.so --load-module=/path/to/module2.so""",
6969
default=[],
7070
)
7171

@@ -75,8 +75,8 @@ def pytest_addoption(parser):
7575
help="""Comma-separated list of cluster endpoints for standalone cluster in the format host1:port1,host2:port2,...
7676
Note: The cluster will be flashed between tests.
7777
Example:
78-
pytest --asyncio-mode=auto --cluster-endpoints=127.0.0.1:6379
79-
pytest --asyncio-mode=auto --cluster-endpoints=127.0.0.1:6379,127.0.0.1:6380
78+
pytest -v --asyncio-mode=auto --cluster-endpoints=127.0.0.1:6379
79+
pytest -v --asyncio-mode=auto --cluster-endpoints=127.0.0.1:6379,127.0.0.1:6380
8080
""",
8181
default=None,
8282
)
@@ -87,8 +87,8 @@ def pytest_addoption(parser):
8787
help="""Comma-separated list of cluster endpoints for cluster mode cluster in the format host1:port1,host2:port2,...
8888
Note: The cluster will be flashed between tests.
8989
Example:
90-
pytest --asyncio-mode=auto --standalone-endpoints=127.0.0.1:6379
91-
pytest --asyncio-mode=auto --standalone-endpoints=127.0.0.1:6379,127.0.0.1:6380
90+
pytest -v --asyncio-mode=auto --standalone-endpoints=127.0.0.1:6379
91+
pytest -v --asyncio-mode=auto --standalone-endpoints=127.0.0.1:6379,127.0.0.1:6380
9292
""",
9393
default=None,
9494
)

0 commit comments

Comments
 (0)