This file is indexed.

/usr/share/doc/python-pytest/html/customize.html is in python-pytest-doc 3.3.2-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Configuration &#8212; pytest documentation</title>
    <link rel="stylesheet" href="_static/flasky.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '3.3',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true,
        SOURCELINK_SUFFIX: '.txt'
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="shortcut icon" href="_static/pytest1favi.ico"/>
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Examples and customization tricks" href="example/index.html" />
    <link rel="prev" title="pytest import mechanisms and sys.path/PYTHONPATH" href="pythonpath.html" />
   
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">

  </head>
  <body>
  
  
  


    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="example/index.html" title="Examples and customization tricks"
             accesskey="N">next</a></li>
        <li class="right" >
          <a href="pythonpath.html" title="pytest import mechanisms and sys.path/PYTHONPATH"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="contents.html">pytest-3.3</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="configuration">
<h1>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline"></a></h1>
<div class="section" id="command-line-options-and-configuration-file-settings">
<h2>Command line options and configuration file settings<a class="headerlink" href="#command-line-options-and-configuration-file-settings" title="Permalink to this headline"></a></h2>
<p>You can get help on command line options and values in INI-style
configurations files by using the general help option:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">pytest</span> <span class="o">-</span><span class="n">h</span>   <span class="c1"># prints options _and_ config file settings</span>
</pre></div>
</div>
<p>This will display command line and configuration file settings
which were registered by installed plugins.</p>
</div>
<div class="section" id="initialization-determining-rootdir-and-inifile">
<span id="inifiles"></span><span id="rootdir"></span><h2>Initialization: determining rootdir and inifile<a class="headerlink" href="#initialization-determining-rootdir-and-inifile" title="Permalink to this headline"></a></h2>
<div class="versionadded">
<p><span class="versionmodified">New in version 2.7.</span></p>
</div>
<p>pytest determines a <code class="docutils literal"><span class="pre">rootdir</span></code> for each test run which depends on
the command line arguments (specified test files, paths) and on
the existence of <em>ini-files</em>.  The determined <code class="docutils literal"><span class="pre">rootdir</span></code> and <em>ini-file</em> are
printed as part of the pytest header during startup.</p>
<p>Here's a summary what <code class="docutils literal"><span class="pre">pytest</span></code> uses <code class="docutils literal"><span class="pre">rootdir</span></code> for:</p>
<ul class="simple">
<li>Construct <em>nodeids</em> during collection; each test is assigned
a unique <em>nodeid</em> which is rooted at the <code class="docutils literal"><span class="pre">rootdir</span></code> and takes in account full path,
class name, function name and parametrization (if any).</li>
<li>Is used by plugins as a stable location to store project/test run specific information;
for example, the internal <a class="reference internal" href="cache.html#cache"><span class="std std-ref">cache</span></a> plugin creates a <code class="docutils literal"><span class="pre">.cache</span></code> subdirectory
in <code class="docutils literal"><span class="pre">rootdir</span></code> to store its cross-test run state.</li>
</ul>
<p>Important to emphasize that <code class="docutils literal"><span class="pre">rootdir</span></code> is <strong>NOT</strong> used to modify <code class="docutils literal"><span class="pre">sys.path</span></code>/<code class="docutils literal"><span class="pre">PYTHONPATH</span></code> or
influence how modules are imported. See <a class="reference internal" href="pythonpath.html#pythonpath"><span class="std std-ref">pytest import mechanisms and sys.path/PYTHONPATH</span></a> for more details.</p>
<div class="section" id="finding-the-rootdir">
<h3>Finding the <code class="docutils literal"><span class="pre">rootdir</span></code><a class="headerlink" href="#finding-the-rootdir" title="Permalink to this headline"></a></h3>
<p>Here is the algorithm which finds the rootdir from <code class="docutils literal"><span class="pre">args</span></code>:</p>
<ul class="simple">
<li>determine the common ancestor directory for the specified <code class="docutils literal"><span class="pre">args</span></code> that are
recognised as paths that exist in the file system. If no such paths are
found, the common ancestor directory is set to the current working directory.</li>
<li>look for <code class="docutils literal"><span class="pre">pytest.ini</span></code>, <code class="docutils literal"><span class="pre">tox.ini</span></code> and <code class="docutils literal"><span class="pre">setup.cfg</span></code> files in the ancestor
directory and upwards.  If one is matched, it becomes the ini-file and its
directory becomes the rootdir.</li>
<li>if no ini-file was found, look for <code class="docutils literal"><span class="pre">setup.py</span></code> upwards from the common
ancestor directory to determine the <code class="docutils literal"><span class="pre">rootdir</span></code>.</li>
<li>if no <code class="docutils literal"><span class="pre">setup.py</span></code> was found, look for <code class="docutils literal"><span class="pre">pytest.ini</span></code>, <code class="docutils literal"><span class="pre">tox.ini</span></code> and
<code class="docutils literal"><span class="pre">setup.cfg</span></code> in each of the specified <code class="docutils literal"><span class="pre">args</span></code> and upwards. If one is
matched, it becomes the ini-file and its directory becomes the rootdir.</li>
<li>if no ini-file was found, use the already determined common ancestor as root
directory. This allows the use of pytest in structures that are not part of
a package and don't have any particular ini-file configuration.</li>
</ul>
<p>If no <code class="docutils literal"><span class="pre">args</span></code> are given, pytest collects test below the current working
directory and also starts determining the rootdir from there.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">warning:</th><td class="field-body">custom pytest plugin commandline arguments may include a path, as in
<code class="docutils literal"><span class="pre">pytest</span> <span class="pre">--log-output</span> <span class="pre">../../test.log</span> <span class="pre">args</span></code>. Then <code class="docutils literal"><span class="pre">args</span></code> is mandatory,
otherwise pytest uses the folder of test.log for rootdir determination
(see also <a class="reference external" href="https://github.com/pytest-dev/pytest/issues/1435">issue 1435</a>).
A dot <code class="docutils literal"><span class="pre">.</span></code> for referencing to the current working directory is also
possible.</td>
</tr>
</tbody>
</table>
<p>Note that an existing <code class="docutils literal"><span class="pre">pytest.ini</span></code> file will always be considered a match,
whereas <code class="docutils literal"><span class="pre">tox.ini</span></code> and <code class="docutils literal"><span class="pre">setup.cfg</span></code> will only match if they contain a
<code class="docutils literal"><span class="pre">[pytest]</span></code> or <code class="docutils literal"><span class="pre">[tool:pytest]</span></code> section, respectively. Options from multiple ini-files candidates are never
merged - the first one wins (<code class="docutils literal"><span class="pre">pytest.ini</span></code> always wins, even if it does not
contain a <code class="docutils literal"><span class="pre">[pytest]</span></code> section).</p>
<p>The <code class="docutils literal"><span class="pre">config</span></code> object will subsequently carry these attributes:</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">config.rootdir</span></code>: the determined root directory, guaranteed to exist.</li>
<li><code class="docutils literal"><span class="pre">config.inifile</span></code>: the determined ini-file, may be <code class="docutils literal"><span class="pre">None</span></code>.</li>
</ul>
<p>The rootdir is used a reference directory for constructing test
addresses (&quot;nodeids&quot;) and can be used also by plugins for storing
per-testrun information.</p>
<p>Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">pytest</span> <span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">testdir</span> <span class="n">path</span><span class="o">/</span><span class="n">other</span><span class="o">/</span>
</pre></div>
</div>
<p>will determine the common ancestor as <code class="docutils literal"><span class="pre">path</span></code> and then
check for ini-files as follows:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># first look for pytest.ini files</span>
<span class="n">path</span><span class="o">/</span><span class="n">pytest</span><span class="o">.</span><span class="n">ini</span>
<span class="n">path</span><span class="o">/</span><span class="n">setup</span><span class="o">.</span><span class="n">cfg</span>  <span class="c1"># must also contain [tool:pytest] section to match</span>
<span class="n">path</span><span class="o">/</span><span class="n">tox</span><span class="o">.</span><span class="n">ini</span>    <span class="c1"># must also contain [pytest] section to match</span>
<span class="n">pytest</span><span class="o">.</span><span class="n">ini</span>
<span class="o">...</span> <span class="c1"># all the way down to the root</span>

<span class="c1"># now look for setup.py</span>
<span class="n">path</span><span class="o">/</span><span class="n">setup</span><span class="o">.</span><span class="n">py</span>
<span class="n">setup</span><span class="o">.</span><span class="n">py</span>
<span class="o">...</span> <span class="c1"># all the way down to the root</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="adding-default-options">
<span id="how-to-change-command-line-options-defaults"></span><span id="id1"></span><h2>How to change command line options defaults<a class="headerlink" href="#adding-default-options" title="Permalink to this headline"></a></h2>
<p>It can be tedious to type the same series of command line options
every time you use <code class="docutils literal"><span class="pre">pytest</span></code>.  For example, if you always want to see
detailed info on skipped and xfailed tests, as well as have terser &quot;dot&quot;
progress output, you can write it into a configuration file:</p>
<div class="highlight-ini"><div class="highlight"><pre><span></span><span class="c1"># content of pytest.ini</span>
<span class="c1"># (or tox.ini or setup.cfg)</span>
<span class="k">[pytest]</span>
<span class="na">addopts</span> <span class="o">=</span> <span class="s">-ra -q</span>
</pre></div>
</div>
<p>Alternatively, you can set a <code class="docutils literal"><span class="pre">PYTEST_ADDOPTS</span></code> environment variable to add command
line options while the environment is in use:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">export</span> <span class="n">PYTEST_ADDOPTS</span><span class="o">=</span><span class="s2">&quot;-v&quot;</span>
</pre></div>
</div>
<p>Here's how the command-line is built in the presence of <code class="docutils literal"><span class="pre">addopts</span></code> or the environment variable:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>&lt;pytest.ini:addopts&gt; $PYTEST_ADDOTPS &lt;extra command-line arguments&gt;
</pre></div>
</div>
<p>So if the user executes in the command-line:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">pytest</span> <span class="o">-</span><span class="n">m</span> <span class="n">slow</span>
</pre></div>
</div>
<p>The actual command line executed is:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">pytest</span> <span class="o">-</span><span class="n">ra</span> <span class="o">-</span><span class="n">q</span> <span class="o">-</span><span class="n">v</span> <span class="o">-</span><span class="n">m</span> <span class="n">slow</span>
</pre></div>
</div>
<p>Note that as usual for other command-line applications, in case of conflicting options the last one wins, so the example
above will show verbose output because <code class="docutils literal"><span class="pre">-v</span></code> overwrites <code class="docutils literal"><span class="pre">-q</span></code>.</p>
</div>
<div class="section" id="builtin-configuration-file-options">
<h2>Builtin configuration file options<a class="headerlink" href="#builtin-configuration-file-options" title="Permalink to this headline"></a></h2>
<dl class="confval">
<dt id="confval-minversion">
<code class="descname">minversion</code><a class="headerlink" href="#confval-minversion" title="Permalink to this definition"></a></dt>
<dd><p>Specifies a minimal pytest version required for running tests.</p>
<blockquote>
<div>minversion = 2.1  # will fail if we run with pytest-2.0</div></blockquote>
</dd></dl>

<dl class="confval">
<dt id="confval-addopts">
<code class="descname">addopts</code><a class="headerlink" href="#confval-addopts" title="Permalink to this definition"></a></dt>
<dd><p>Add the specified <code class="docutils literal"><span class="pre">OPTS</span></code> to the set of command line arguments as if they
had been specified by the user. Example: if you have this ini file content:</p>
<div class="highlight-ini"><div class="highlight"><pre><span></span><span class="k">[pytest]</span>
<span class="na">addopts</span> <span class="o">=</span> <span class="s">--maxfail=2 -rf  # exit after 2 failures, report fail info</span>
</pre></div>
</div>
<p>issuing <code class="docutils literal"><span class="pre">pytest</span> <span class="pre">test_hello.py</span></code> actually means:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">pytest</span> <span class="o">--</span><span class="n">maxfail</span><span class="o">=</span><span class="mi">2</span> <span class="o">-</span><span class="n">rf</span> <span class="n">test_hello</span><span class="o">.</span><span class="n">py</span>
</pre></div>
</div>
<p>Default is to add no options.</p>
</dd></dl>

<dl class="confval">
<dt id="confval-norecursedirs">
<code class="descname">norecursedirs</code><a class="headerlink" href="#confval-norecursedirs" title="Permalink to this definition"></a></dt>
<dd><p>Set the directory basename patterns to avoid when recursing
for test discovery.  The individual (fnmatch-style) patterns are
applied to the basename of a directory to decide if to recurse into it.
Pattern matching characters:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>*       matches everything
?       matches any single character
[seq]   matches any character in seq
[!seq]  matches any char not in seq
</pre></div>
</div>
<p>Default patterns are <code class="docutils literal"><span class="pre">'.*',</span> <span class="pre">'build',</span> <span class="pre">'dist',</span> <span class="pre">'CVS',</span> <span class="pre">'_darcs',</span> <span class="pre">'{arch}',</span> <span class="pre">'*.egg',</span> <span class="pre">'venv'</span></code>.
Setting a <code class="docutils literal"><span class="pre">norecursedirs</span></code> replaces the default.  Here is an example of
how to avoid certain directories:</p>
<div class="highlight-ini"><div class="highlight"><pre><span></span><span class="c1"># content of pytest.ini</span>
<span class="k">[pytest]</span>
<span class="na">norecursedirs</span> <span class="o">=</span> <span class="s">.svn _build tmp*</span>
</pre></div>
</div>
<p>This would tell <code class="docutils literal"><span class="pre">pytest</span></code> to not look into typical subversion or
sphinx-build directories or into any <code class="docutils literal"><span class="pre">tmp</span></code> prefixed directory.</p>
<p>Additionally, <code class="docutils literal"><span class="pre">pytest</span></code> will attempt to intelligently identify and ignore a
virtualenv by the presence of an activation script.  Any directory deemed to
be the root of a virtual environment will not be considered during test
collection unless <code class="docutils literal"><span class="pre">‑‑collect‑in‑virtualenv</span></code> is given.  Note also that
<code class="docutils literal"><span class="pre">norecursedirs</span></code> takes precedence over <code class="docutils literal"><span class="pre">‑‑collect‑in‑virtualenv</span></code>; e.g. if
you intend to run tests in a virtualenv with a base directory that matches
<code class="docutils literal"><span class="pre">'.*'</span></code> you <em>must</em> override <code class="docutils literal"><span class="pre">norecursedirs</span></code> in addition to using the
<code class="docutils literal"><span class="pre">‑‑collect‑in‑virtualenv</span></code> flag.</p>
</dd></dl>

<dl class="confval">
<dt id="confval-testpaths">
<code class="descname">testpaths</code><a class="headerlink" href="#confval-testpaths" title="Permalink to this definition"></a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 2.8.</span></p>
</div>
<p>Sets list of directories that should be searched for tests when
no specific directories, files or test ids are given in the command line when
executing pytest from the <a class="reference internal" href="#rootdir"><span class="std std-ref">rootdir</span></a> directory.
Useful when all project tests are in a known location to speed up
test collection and to avoid picking up undesired tests by accident.</p>
<div class="highlight-ini"><div class="highlight"><pre><span></span><span class="c1"># content of pytest.ini</span>
<span class="k">[pytest]</span>
<span class="na">testpaths</span> <span class="o">=</span> <span class="s">testing doc</span>
</pre></div>
</div>
<p>This tells pytest to only look for tests in <code class="docutils literal"><span class="pre">testing</span></code> and <code class="docutils literal"><span class="pre">doc</span></code>
directories when executing from the root directory.</p>
</dd></dl>

<dl class="confval">
<dt id="confval-python_files">
<code class="descname">python_files</code><a class="headerlink" href="#confval-python_files" title="Permalink to this definition"></a></dt>
<dd><p>One or more Glob-style file patterns determining which python files
are considered as test modules. By default, pytest will consider
any file matching with <code class="docutils literal"><span class="pre">test_*.py</span></code> and <code class="docutils literal"><span class="pre">*_test.py</span></code> globs as a test
module.</p>
</dd></dl>

<dl class="confval">
<dt id="confval-python_classes">
<code class="descname">python_classes</code><a class="headerlink" href="#confval-python_classes" title="Permalink to this definition"></a></dt>
<dd><p>One or more name prefixes or glob-style patterns determining which classes
are considered for test collection. By default, pytest will consider any
class prefixed with <code class="docutils literal"><span class="pre">Test</span></code> as a test collection.  Here is an example of how
to collect tests from classes that end in <code class="docutils literal"><span class="pre">Suite</span></code>:</p>
<div class="highlight-ini"><div class="highlight"><pre><span></span><span class="c1"># content of pytest.ini</span>
<span class="k">[pytest]</span>
<span class="na">python_classes</span> <span class="o">=</span> <span class="s">*Suite</span>
</pre></div>
</div>
<p>Note that <code class="docutils literal"><span class="pre">unittest.TestCase</span></code> derived classes are always collected
regardless of this option, as <code class="docutils literal"><span class="pre">unittest</span></code>'s own collection framework is used
to collect those tests.</p>
</dd></dl>

<dl class="confval">
<dt id="confval-python_functions">
<code class="descname">python_functions</code><a class="headerlink" href="#confval-python_functions" title="Permalink to this definition"></a></dt>
<dd><p>One or more name prefixes or glob-patterns determining which test functions
and methods are considered tests. By default, pytest will consider any
function prefixed with <code class="docutils literal"><span class="pre">test</span></code> as a test.  Here is an example of how
to collect test functions and methods that end in <code class="docutils literal"><span class="pre">_test</span></code>:</p>
<div class="highlight-ini"><div class="highlight"><pre><span></span><span class="c1"># content of pytest.ini</span>
<span class="k">[pytest]</span>
<span class="na">python_functions</span> <span class="o">=</span> <span class="s">*_test</span>
</pre></div>
</div>
<p>Note that this has no effect on methods that live on a <code class="docutils literal"><span class="pre">unittest</span>
<span class="pre">.TestCase</span></code> derived class, as <code class="docutils literal"><span class="pre">unittest</span></code>'s own collection framework is used
to collect those tests.</p>
<p>See <a class="reference internal" href="example/pythoncollection.html#change-naming-conventions"><span class="std std-ref">Changing naming conventions</span></a> for more detailed examples.</p>
</dd></dl>

<dl class="confval">
<dt id="confval-doctest_optionflags">
<code class="descname">doctest_optionflags</code><a class="headerlink" href="#confval-doctest_optionflags" title="Permalink to this definition"></a></dt>
<dd><p>One or more doctest flag names from the standard <code class="docutils literal"><span class="pre">doctest</span></code> module.
<a class="reference internal" href="doctest.html"><span class="doc">See how pytest handles doctests</span></a>.</p>
</dd></dl>

<dl class="confval">
<dt id="confval-confcutdir">
<code class="descname">confcutdir</code><a class="headerlink" href="#confval-confcutdir" title="Permalink to this definition"></a></dt>
<dd><p>Sets a directory where search upwards for <code class="docutils literal"><span class="pre">conftest.py</span></code> files stops.
By default, pytest will stop searching for <code class="docutils literal"><span class="pre">conftest.py</span></code> files upwards
from <code class="docutils literal"><span class="pre">pytest.ini</span></code>/<code class="docutils literal"><span class="pre">tox.ini</span></code>/<code class="docutils literal"><span class="pre">setup.cfg</span></code> of the project if any,
or up to the file-system root.</p>
</dd></dl>

<dl class="confval">
<dt id="confval-filterwarnings">
<code class="descname">filterwarnings</code><a class="headerlink" href="#confval-filterwarnings" title="Permalink to this definition"></a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 3.1.</span></p>
</div>
<p>Sets a list of filters and actions that should be taken for matched
warnings. By default all warnings emitted during the test session
will be displayed in a summary at the end of the test session.</p>
<div class="highlight-ini"><div class="highlight"><pre><span></span><span class="c1"># content of pytest.ini</span>
<span class="k">[pytest]</span>
<span class="na">filterwarnings</span> <span class="o">=</span><span class="s"></span>
<span class="s">    error</span>
<span class="s">    ignore::DeprecationWarning</span>
</pre></div>
</div>
<p>This tells pytest to ignore deprecation warnings and turn all other warnings
into errors. For more information please refer to <a class="reference internal" href="warnings.html#warnings"><span class="std std-ref">Warnings Capture</span></a>.</p>
</dd></dl>

<dl class="confval">
<dt id="confval-cache_dir">
<code class="descname">cache_dir</code><a class="headerlink" href="#confval-cache_dir" title="Permalink to this definition"></a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 3.2.</span></p>
</div>
<p>Sets a directory where stores content of cache plugin. Default directory is
<code class="docutils literal"><span class="pre">.cache</span></code> which is created in <a class="reference internal" href="#rootdir"><span class="std std-ref">rootdir</span></a>. Directory may be
relative or absolute path. If setting relative path, then directory is created
relative to <a class="reference internal" href="#rootdir"><span class="std std-ref">rootdir</span></a>. Additionally path may contain environment
variables, that will be expanded. For more information about cache plugin
please refer to <a class="reference internal" href="cache.html#cache-provider"><span class="std std-ref">Cache: working with cross-testrun state</span></a>.</p>
</dd></dl>

<dl class="confval">
<dt id="confval-console_output_style">
<code class="descname">console_output_style</code><a class="headerlink" href="#confval-console_output_style" title="Permalink to this definition"></a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 3.3.</span></p>
</div>
<p>Sets the console output style while running tests:</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">classic</span></code>: classic pytest output.</li>
<li><code class="docutils literal"><span class="pre">progress</span></code>: like classic pytest output, but with a progress indicator.</li>
</ul>
<p>The default is <code class="docutils literal"><span class="pre">progress</span></code>, but you can fallback to <code class="docutils literal"><span class="pre">classic</span></code> if you prefer or
the new mode is causing unexpected problems:</p>
<div class="highlight-ini"><div class="highlight"><pre><span></span><span class="c1"># content of pytest.ini</span>
<span class="k">[pytest]</span>
<span class="na">console_output_style</span> <span class="o">=</span> <span class="s">classic</span>
</pre></div>
</div>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="contents.html">
              <img class="logo" src="_static/pytest1.png" alt="Logo"/>
            </a></p><h3><a href="contents.html">Table Of Contents</a></h3>

<ul>
  <li><a href="index.html">Home</a></li>
  <li><a href="contents.html">Contents</a></li>
  <li><a href="getting-started.html">Install</a></li>
  <li><a href="example/index.html">Examples</a></li>
  <li><a href="#">Customize</a></li>
  <li><a href="contact.html">Contact</a></li>
  <li><a href="talks.html">Talks/Posts</a></li>
  <li><a href="changelog.html">Changelog</a></li>
  <li><a href="backwards-compatibility.html">Backwards Compatibility</a></li>
  <li><a href="license.html">License</a></li>
</ul>
  <hr>
  <ul>
<li><a class="reference internal" href="#">Configuration</a><ul>
<li><a class="reference internal" href="#command-line-options-and-configuration-file-settings">Command line options and configuration file settings</a></li>
<li><a class="reference internal" href="#initialization-determining-rootdir-and-inifile">Initialization: determining rootdir and inifile</a><ul>
<li><a class="reference internal" href="#finding-the-rootdir">Finding the <code class="docutils literal"><span class="pre">rootdir</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#adding-default-options">How to change command line options defaults</a></li>
<li><a class="reference internal" href="#builtin-configuration-file-options">Builtin configuration file options</a></li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
  <li><a href="contents.html">Documentation overview</a><ul>
      <li>Previous: <a href="pythonpath.html" title="previous chapter">pytest import mechanisms and <code class="docutils literal"><span class="pre">sys.path</span></code>/<code class="docutils literal"><span class="pre">PYTHONPATH</span></code></a></li>
      <li>Next: <a href="example/index.html" title="next chapter">Examples and customization tricks</a></li>
  </ul></li>
</ul><h3>Useful Links</h3>
<ul>
  <li><a href="index.html">The pytest Website</a></li>
  <li><a href="contributing.html">Contribution Guide</a></li>
  <li><a href="https://pypi.python.org/pypi/pytest">pytest @ PyPI</a></li>
  <li><a href="https://github.com/pytest-dev/pytest/">pytest @ GitHub</a></li>
  <li><a href="http://plugincompat.herokuapp.com/">3rd party plugins</a></li>
  <li><a href="https://github.com/pytest-dev/pytest/issues">Issue Tracker</a></li>
  <li><a href="https://media.readthedocs.org/pdf/pytest/latest/pytest.pdf">PDF Documentation</a>
</ul>

<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>

  <div class="footer">
    &copy; Copyright 2018, holger krekel and pytest-dev team.
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
  </div>
  

  </body>
</html>