Skip to content

Commit 0dcc7b6

Browse files
authored
Add profile option to pytest. (#1991)
1 parent dddc79f commit 0dcc7b6

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
- name: pytest
104104
run: |
105105
env
106-
pytest -v --cov --full-trace --timeout=1200
106+
pytest -v --cov
107107
108108
analyze:
109109
name: Analyze Python

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ __pycache__/
1313
.vscode
1414
.vscode/
1515
build/
16+
prof/
1617
/dist/
1718
/pymodbus.egg-info/
1819
venv
1920
downloaded_files/
20-
htmlcov/

README.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ There are 2 bigger projects ongoing:
274274
* Add features to and simulator, and enhance the web design
275275

276276

277-
Development Instructions
277+
Development instructions
278278
------------------------
279279
The current code base is compatible with python >= 3.8.
280280

@@ -295,12 +295,15 @@ Make a pull request::
295295

296296
on github open a pull request, check that CI turns green and then wait for review comments.
297297

298-
299298
Test your changes::
300299

301300
cd test
302301
pytest
303302

303+
you can also do extended testing::
304+
305+
pytest --cov <-- Coverage html report in build/html
306+
pytest --profile <-- Call profile report in prof
304307

305308
Internals
306309
^^^^^^^^^

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ development = [
7474
"pytest>=7.3.1",
7575
"pytest-asyncio>=0.20.3",
7676
"pytest-cov>=4.1.0",
77+
"pytest-profiling>=1.7.0",
7778
"pytest-timeout>=2.2.0",
7879
"pytest-xdist>=3.3.1",
7980
"ruff>=0.2.0",
@@ -220,9 +221,9 @@ all_files = "1"
220221

221222
[tool.pytest.ini_options]
222223
testpaths = ["test"]
223-
addopts = "-p no:warnings --dist loadscope --numprocesses auto"
224+
addopts = "-p no:warnings --durations=10 --dist loadscope --numprocesses auto"
224225
asyncio_mode = "auto"
225-
timeout = 40
226+
timeout = 120
226227

227228
[tool.coverage.run]
228229
source = [

0 commit comments

Comments
 (0)