Skip to content

Commit e9fdde3

Browse files
update contributing.md with new commands
and learn about pytest substring expressions
1 parent 76f3acc commit e9fdde3

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,14 @@ python runtests.py self
7676
# or equivalently:
7777
python -m mypy --config-file mypy_self_check.ini -p mypy
7878

79-
# Run a single test from the test suite
80-
pytest -n0 -k 'test_name'
79+
# Run a single test from the test suite (uses pytest substring expression matching)
80+
python runtests.py test_name
81+
# or equivalently:
82+
pytest -n0 -k test_name
8183

8284
# Run all test cases in the "test-data/unit/check-dataclasses.test" file
85+
python runtests.py check-dataclasses.test
86+
# or equivalently:
8387
pytest mypy/test/testcheck.py::TypeCheckSuite::check-dataclasses.test
8488

8589
# Run the formatters and linters

runtests.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,9 @@ def main() -> None:
160160
print(
161161
"Run the given tests. If given no arguments, run everything except"
162162
+ " pytest-extra and mypyc-extra. Unrecognized arguments will be"
163-
+ " interpreted as individual test names (or, if they end in .test,"
164-
+ " individual test files) and this script will try to run them."
163+
+ " interpreted as individual test names / substring expressions"
164+
+ " (or, if they end in .test, individual test files)"
165+
+ " and this script will try to run them."
165166
)
166167
if "-h" in args or "--help" in args:
167168
exit(1)

0 commit comments

Comments
 (0)