forked from CleanCut/green
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli-options.txt
140 lines (122 loc) · 7.3 KB
/
cli-options.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
usage: green [options] [target [target2 ...]]
Green is a clean, colorful, fast test runner for Python unit tests.
Target Specification:
target Targets to test. Any number of targets may be
specified. If blank, then discover all testcases in
the current directory tree. Can be a directory (or
package), file (or module), or fully-qualified 'dotted
name' like proj.tests.test_things.TestStuff. If a
directory (or package) is specified, then we will
attempt to discover all tests under the directory
(even if the directory is a package and the tests
would not be accessible through the package's scope).
In all other cases, only tests accessible from
introspection of the object will be loaded.
Concurrency Options:
-s NUM, --processes NUM
Number of processes to use to run tests. Note that
your tests need to be written to avoid using the same
resources (temp files, sockets, ports, etc.) for the
multi-process mode to work well (--initializer and
--finalizer can help provision per-process resources).
Default is to run the same number of processes as your
machine has logical CPUs. Note that for a small number
of trivial tests, running everything in a single
process may be faster than the overhead of
initializing all the processes.
-i DOTTED_FUNCTION, --initializer DOTTED_FUNCTION
Python function to run inside of a single worker
process before it starts running tests. This is the
way to provision external resources that each
concurrent worker process needs to have exclusive
access to. Specify the function in dotted notation in
a way that will be importable from the location you
are running green from.
-z DOTTED_FUNCTION, --finalizer DOTTED_FUNCTION
Same as --initializer, only run at the end of a worker
process's lifetime. Used to unprovision resources
provisioned by the initializer.
Format Options:
-t, --termcolor Force terminal colors on. Default is to autodetect.
-T, --notermcolor Force terminal colors off. Default is to autodetect.
-W, --disable-windows
Disable Windows support by turning off Colorama
Output Options:
-a, --allow-stdout Instead of capturing the stdout and stderr and
presenting it in the summary of results, let it come
through.
-q, --quiet-stdout Instead of capturing the stdout and stderr and
presenting it in the summary of results, discard it
completly for successful tests. --allow-stdout option
overrides it.
-k, --no-skip-report Don't print the report of skipped tests after testing
is done. Skips will still show up in the progress
report and summary count.
-h, --help Show this help message and exit.
-V, --version Print the version of Green and Python and exit.
-l, --logging Don't configure the root logger to redirect to
/dev/null, enabling internal debugging output
-d, --debug Enable internal debugging statements. Implies
--logging. Can be specified up to three times for more
debug output.
-v, --verbose Verbose. Can be specified up to three times for more
verbosity. Recommended levels are -v and -vv.
Other Options:
-f, --failfast Stop execution at the first test that fails, errors,
or unexpectedly succeeds.
-c FILE, --config FILE
Use this config file instead of the one pointed to by
environment variable GREEN_CONFIG or the default
~/.green
-p PATTERN, --file-pattern PATTERN
Pattern to match test files. Default is test*.py
-n PATTERN, --test-pattern PATTERN
Pattern to match test method names after 'test'.
Default is '*', meaning match methods named 'test*'.
Coverage Options (Coverage 4.3.4):
-r, --run-coverage Produce coverage output.
-R, --quiet-coverage Do not print coverage report to stdout (coverage files
will still be created). Implies --run-coverage
-O, --clear-omit Green tries really hard to set up a good list of
patterns of files to omit from coverage reports. If
the default list catches files that you DO want to
cover you can specify this flag to leave the default
list empty to start with. You can then add patterns
back in with --omit-add. The default list is something
like '*/test*,*/termstyle*,*/mock*,*(temp
dir)*,*(python system packages)*' -- only longer.
-u PATTERN, --include-patterns PATTERN
Comma-separated file-patterns to include in coverage.
This implies that anything that does not match the
include pattern is omitted from coverage reporting.
-o PATTERN, --omit-patterns PATTERN
Comma-separated file-patterns to omit from coverage.
For example, if coverage reported a file
mypackage/foo/bar you couldomit it from coverage with
'mypackage*', '*/foo/*', or '*bar'
Integration Options:
--completion-file Location of the bash- and zsh-completion file. To
enable bash- or zsh-completion, see ENABLING SHELL
COMPLETION below.
--completions Output possible completions of the given target. Used
by bash- and zsh-completion.
--options Output all options. Used by bash- and zsh-completion.
ENABLING SHELL COMPLETION
To enable bash- or zsh-completion, add the line below to the end of your
.bashrc or .zshrc file (or equivalent config file):
which green >& /dev/null && source "$( green --completion-file )"
Warning! Generating a completion list actually discovers and loads tests
-- this can be very slow if you run it in huge directories!
CONFIG FILES
Green will look for and process three config files if found:
1) $HOME/.green
2) $GREEN_CONFIG
3) A file specified with "--config FILE"
Config file format is simply "option = value" on separate lines. "option" is
the same as the long options above, just without the "--".
Most values should be "True" or "False". Accumulated values (verbose, debug)
should be specified as integers ("-vv" would be "verbose = 2").
Example:
verbose = 2
logging = True
omit-patterns = myproj*,*prototype*