Skip to content

Commit f75962f

Browse files
psrbatodorov
authored andcommitted
Pass arguments of test.sh to test_func/pytest
Previously you had to modify scripts/test.sh to add command line arguments to pytest. Now you can add them directly when calling test.sh. This is useful if you, for example, want to filter the executed tests using `-k`.
1 parent 85430c5 commit f75962f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ a test name, and insert into it some code. The tests will run pylint
124124
against these modules. If the idea is that no messages now occur, then
125125
that is fine, just check to see if it works by running ``scripts/test.sh``.
126126

127+
Any command line argument passed to ``scripts/test.sh`` will be passed to the internal invocation of ``pytest``.
128+
For example if you want to debug the tests you can execute ``scripts/test.sh --capture=no``.
129+
A specific test case can be run by filtering based on the file name of the test case ``./scripts/test.sh -k 'func_noerror_views'``.
130+
127131
Ideally, add some pylint error suppression messages to the file to prevent
128132
spurious warnings, since these are all tiny little modules not designed to
129133
do anything so there's no need to be perfect.

scripts/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
python pylint_django/tests/test_func.py -v
2+
python pylint_django/tests/test_func.py -v "$@"

0 commit comments

Comments
 (0)