Skip to content

Commit 0056712

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 0056712

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test_manage_py_scan.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ 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 hasattr(pytest, "version_tuple") and pytest.version_tuple >= (7, 0):
122+
version_out = result.stdout
123+
else:
124+
version_out = result.stderr
125+
126+
version_out.fnmatch_lines(["*This is pytest version*"])
122127

123128
result = django_testdir.runpytest_subprocess("django_project_root", "--help")
124129
assert result.ret == 0

0 commit comments

Comments
 (0)