From 16df4da1f7af6e2a4b06e46b9b3263feee2821a5 Mon Sep 17 00:00:00 2001 From: Antoine Legrand <2t.antoine@gmail.com> Date: Tue, 6 Jun 2017 04:21:29 +0200 Subject: [PATCH 1/2] Fix exclude_path check --- _pytest/main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/_pytest/main.py b/_pytest/main.py index 480810cc8..79bdc4006 100644 --- a/_pytest/main.py +++ b/_pytest/main.py @@ -168,14 +168,13 @@ def pytest_runtestloop(session): def pytest_ignore_collect(path, config): - p = path.dirpath() - ignore_paths = config._getconftest_pathlist("collect_ignore", path=p) + ignore_paths = config._getconftest_pathlist("collect_ignore", path=path.dirpath()) ignore_paths = ignore_paths or [] excludeopt = config.getoption("ignore") if excludeopt: ignore_paths.extend([py.path.local(x) for x in excludeopt]) - if path in ignore_paths: + if py.path.local(path) in ignore_paths: return True # Skip duplicate paths. From c578418791466341f7b1ebce5152182ef966e239 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 3 Jul 2017 12:39:17 -0300 Subject: [PATCH 2/2] Add changelog for triple leading '/' problem. --- changelog/2475.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/2475.bugfix diff --git a/changelog/2475.bugfix b/changelog/2475.bugfix new file mode 100644 index 000000000..a7144d8a8 --- /dev/null +++ b/changelog/2475.bugfix @@ -0,0 +1 @@ +Fix issue where paths collected by pytest could have triple leading ``/`` characters.