Skip to content

Commit d6dfb1a

Browse files
committed
issue 1544: norecursedirs build & dist dirs
1 parent 0f7aeaf commit d6dfb1a

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,19 @@
4141

4242
*
4343

44+
* Add ``build/`` and ``dist/`` to the default ``--norecursedirs`` list. Thanks
45+
`@mikofski`_ for the report and `@tomviner`_ for the PR (`#1544`_).
46+
47+
*
48+
4449
.. _@milliams: https://github.com/milliams
4550
.. _@novas0x2a: https://github.com/novas0x2a
4651
.. _@kalekundert: https://github.com/kalekundert
4752
.. _@tareqalayan: https://github.com/tareqalayan
4853
.. _@ceridwen: https://github.com/ceridwen
4954
.. _@palaviv: https://github.com/palaviv
5055
.. _@omarkohl: https://github.com/omarkohl
56+
.. _@mikofski: https://github.com/mikofski
5157

5258
.. _#1428: https://github.com/pytest-dev/pytest/pull/1428
5359
.. _#1444: https://github.com/pytest-dev/pytest/pull/1444
@@ -58,6 +64,7 @@
5864
.. _#1474: https://github.com/pytest-dev/pytest/pull/1474
5965
.. _#1502: https://github.com/pytest-dev/pytest/pull/1502
6066
.. _#372: https://github.com/pytest-dev/pytest/issues/372
67+
.. _#1544: https://github.com/pytest-dev/pytest/issues/1544
6168

6269
2.9.2.dev1
6370
==========

_pytest/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
def pytest_addoption(parser):
3131
parser.addini("norecursedirs", "directory patterns to avoid for recursion",
32-
type="args", default=['.*', 'CVS', '_darcs', '{arch}', '*.egg'])
32+
type="args", default=['.*', 'build', 'dist', 'CVS', '_darcs', '{arch}', '*.egg'])
3333
parser.addini("testpaths", "directories to search for tests when no files or directories are given in the command line.",
3434
type="args", default=[])
3535
#parser.addini("dirpatterns",

doc/en/customize.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Builtin configuration file options
144144
[seq] matches any character in seq
145145
[!seq] matches any char not in seq
146146

147-
Default patterns are ``'.*', 'CVS', '_darcs', '{arch}', '*.egg'``.
147+
Default patterns are ``'.*', 'build', 'dist', 'CVS', '_darcs', '{arch}', '*.egg'``.
148148
Setting a ``norecursedirs`` replaces the default. Here is an example of
149149
how to avoid certain directories:
150150

testing/test_collection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ def pytest_collect_file(path, parent):
8888
class TestCollectFS:
8989
def test_ignored_certain_directories(self, testdir):
9090
tmpdir = testdir.tmpdir
91+
tmpdir.ensure("build", 'test_notfound.py')
92+
tmpdir.ensure("dist", 'test_notfound.py')
9193
tmpdir.ensure("_darcs", 'test_notfound.py')
9294
tmpdir.ensure("CVS", 'test_notfound.py')
9395
tmpdir.ensure("{arch}", 'test_notfound.py')

0 commit comments

Comments
 (0)