Skip to content

Commit b9f9e92

Browse files
tests: Sync expected stream for Pytest' version
https://docs.pytest.org/en/7.0.x/changelog.html#breaking-changes: > [pytest#8246](pytest-dev/pytest#8246): --version now writes version information to stdout rather than stderr. Fixes: #995 Signed-off-by: Stanislav Levin <[email protected]>
1 parent ed77ef2 commit b9f9e92

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test_manage_py_scan.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,13 @@ def test_django_project_found_invalid_settings_version(django_testdir, monkeypat
118118

119119
result = django_testdir.runpytest_subprocess("django_project_root", "--version", "--version")
120120
assert result.ret == 0
121-
result.stderr.fnmatch_lines(["*This is pytest version*"])
121+
if result.errlines:
122+
version_out = result.stderr
123+
else:
124+
# Pytest 7.0+
125+
version_out = result.stdout
126+
127+
version_out.fnmatch_lines(["*This is pytest version*"])
122128

123129
result = django_testdir.runpytest_subprocess("django_project_root", "--help")
124130
assert result.ret == 0

0 commit comments

Comments
 (0)