nodes: micro-optimize _imply_path

This commit is contained in:
Ran Benita
2021-10-05 19:07:07 +03:00
parent 54811b24e2
commit 076ac901bb
3 changed files with 34 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
import re
import sys
import warnings
from pathlib import Path
from unittest import mock
import pytest
@@ -179,6 +180,13 @@ def test_hookproxy_warnings_for_fspath(tmp_path, hooktype, request):
hooks.pytest_ignore_collect(config=request.config, fspath=tmp_path)
# Passing entirely *different* paths is an outright error.
with pytest.raises(ValueError, match=r"path.*fspath.*need to be equal"):
with pytest.warns(PytestDeprecationWarning, match=PATH_WARN_MATCH) as r:
hooks.pytest_ignore_collect(
config=request.config, path=path, fspath=Path("/bla/bla")
)
def test_warns_none_is_deprecated():
with pytest.warns(