Add str() support to LineMatcher (#8050)

This commit is contained in:
Maximilian Cosmo Sitter
2020-11-21 19:45:20 +01:00
committed by GitHub
parent 52fef811c2
commit 0cef530d10
4 changed files with 17 additions and 2 deletions

View File

@@ -610,6 +610,11 @@ def test_linematcher_no_matching_after_match() -> None:
assert str(e.value).splitlines() == ["fnmatch: '*'", " with: '1'"]
def test_linematcher_string_api() -> None:
lm = LineMatcher(["foo", "bar"])
assert str(lm) == "foo\nbar"
def test_pytester_addopts_before_testdir(request, monkeypatch) -> None:
orig = os.environ.get("PYTEST_ADDOPTS", None)
monkeypatch.setenv("PYTEST_ADDOPTS", "--orig-unused")