diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 816d3eb5b..4abc183d0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -51,6 +51,9 @@ Changes additional parameter. Thanks `@unsignedint`_ for the PR. +* Add ``venv`` to the default ``norecursedirs`` setting. + Thanks `@The-Compiler`_ for the PR. + .. _@davidszotten: https://github.com/davidszotten .. _@fushi: https://github.com/fushi diff --git a/_pytest/main.py b/_pytest/main.py index 41a48cda2..73858e099 100644 --- a/_pytest/main.py +++ b/_pytest/main.py @@ -27,7 +27,7 @@ EXIT_NOTESTSCOLLECTED = 5 def pytest_addoption(parser): parser.addini("norecursedirs", "directory patterns to avoid for recursion", - type="args", default=['.*', 'build', 'dist', 'CVS', '_darcs', '{arch}', '*.egg']) + type="args", default=['.*', 'build', 'dist', 'CVS', '_darcs', '{arch}', '*.egg', 'venv']) 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", diff --git a/doc/en/customize.rst b/doc/en/customize.rst index d12a49037..c6d3eb473 100644 --- a/doc/en/customize.rst +++ b/doc/en/customize.rst @@ -158,7 +158,7 @@ Builtin configuration file options [seq] matches any character in seq [!seq] matches any char not in seq - Default patterns are ``'.*', 'build', 'dist', 'CVS', '_darcs', '{arch}', '*.egg'``. + Default patterns are ``'.*', 'build', 'dist', 'CVS', '_darcs', '{arch}', '*.egg', 'venv'``. Setting a ``norecursedirs`` replaces the default. Here is an example of how to avoid certain directories: