8000 MAINT make pytest collection ignore folders with Python scripts (#12011) · scikit-learn/scikit-learn@242410f · GitHub
[go: up one dir, main page]

Skip to content

Commit 242410f

Browse files
authored
MAINT make pytest collection ignore folders with Python scripts (#12011)
Some IDEs such as VS Code use the pytest command to collect all the tests of the workspace in the background. This can cause unexpected execution of arbitrary Python scripts in the workspace (examples, benchmarks...). The doc folder is also ignored because it has python scripts for sphinx along with copies of the examples. To safely run pytest in the doc folder, we need to used the find command to find all "*.rst" files as done in the project Makefile.
1 parent 5e101a2 commit 242410f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ test = pytest
55
# disable-pytest-warnings should be removed once we rewrite tests
66
# using yield with parametrize
77
addopts =
8+
--ignore build_tools
9+
--ignore benchmarks
10+
--ignore doc
11+
--ignore examples
812
--doctest-modules
913
--disable-pytest-warnings
1014
-rs

0 commit comments

Comments
 (0)
0