Skip to content

Commit 3b4199a

Browse files
seismanweiji14
andauthored
Add instructions to run specific tests (#660)
Runing the full tests using make test is very slow. For most PRs, we may work on only a small fraction of the codes, and it's common that we only need to run specific tests. This PR adds instructions for running specific tests. Co-authored-by: Wei Ji <[email protected]>
1 parent 2c977f5 commit 3b4199a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,14 @@ in your browser. **Strive to get 100% coverage for the lines you changed.**
308308
It's OK if you can't or don't know how to test something.
309309
Leave a comment in the PR and we'll help you out.
310310

311+
You can also run tests in just one test script using:
312+
313+
pytest --verbose --mpl --mpl-results-path=results --doctest_modules pygmt/tests/NAME_OF_TEST_FILE.py
314+
315+
or run tests which contain names that match a specific keyword expression:
316+
317+
pytest --verbose --mpl --mpl-results-path=results --doctest_modules -k KEYWORD pygmt/tests
318+
311319
### Testing plots
312320

313321
Writing an image-based test is only slightly more difficult than a simple test.

0 commit comments

Comments
 (0)