Skip to content

Commit

Permalink
issue 1544: norecursedirs build & dist dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomviner committed May 23, 2016
1 parent 0f7aeaf commit f081461
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,19 @@

*

* Add ``build/`` and ``dist/`` to the default ``--norecursedirs`` list. Thanks
`@mikofski` for the report and `@tomviner` for the PR (`#1544`_).

*

.. _@milliams: https://github.com/milliams
.. _@novas0x2a: https://github.com/novas0x2a
.. _@kalekundert: https://github.com/kalekundert
.. _@tareqalayan: https://github.com/tareqalayan
.. _@ceridwen: https://github.com/ceridwen
.. _@palaviv: https://github.com/palaviv
.. _@omarkohl: https://github.com/omarkohl
.. _@mikofski: https://github.com/mikofski

.. _#1428: https://github.com/pytest-dev/pytest/pull/1428
.. _#1444: https://github.com/pytest-dev/pytest/pull/1444
Expand All @@ -58,6 +64,7 @@
.. _#1474: https://github.com/pytest-dev/pytest/pull/1474
.. _#1502: https://github.com/pytest-dev/pytest/pull/1502
.. _#372: https://github.com/pytest-dev/pytest/issues/372
.. _#1544: https://github.com/pytest-dev/pytest/issues/1544

2.9.2.dev1
==========
Expand Down
2 changes: 1 addition & 1 deletion _pytest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

def pytest_addoption(parser):
parser.addini("norecursedirs", "directory patterns to avoid for recursion",
type="args", default=['.*', 'CVS', '_darcs', '{arch}', '*.egg'])
type="args", default=['.*', 'build', 'dist', 'CVS', '_darcs', '{arch}', '*.egg'])
parser.addini("testpaths", "directories to search for tests when no files or directories are given in the command line.",
type="args", default=[])
#parser.addini("dirpatterns",
Expand Down
2 changes: 1 addition & 1 deletion doc/en/customize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Builtin configuration file options
[seq] matches any character in seq
[!seq] matches any char not in seq

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

Expand Down
2 changes: 2 additions & 0 deletions testing/test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def pytest_collect_file(path, parent):
class TestCollectFS:
def test_ignored_certain_directories(self, testdir):
tmpdir = testdir.tmpdir
tmpdir.ensure("build", 'test_notfound.py')
tmpdir.ensure("dist", 'test_notfound.py')
tmpdir.ensure("_darcs", 'test_notfound.py')
tmpdir.ensure("CVS", 'test_notfound.py')
tmpdir.ensure("{arch}", 'test_notfound.py')
Expand Down

0 comments on commit f081461

Please sign in to comment.