Skip to content

Commit

Permalink
tests: Sync expected stream for Pytest' version
Browse files Browse the repository at this point in the history
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: pytest-dev#995
Signed-off-by: Stanislav Levin <slev@altlinux.org>
  • Loading branch information
stanislavlevin committed Feb 28, 2022
1 parent ed77ef2 commit b9f9e92
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_manage_py_scan.py
Expand Up @@ -118,7 +118,13 @@ def test_django_project_found_invalid_settings_version(django_testdir, monkeypat

result = django_testdir.runpytest_subprocess("django_project_root", "--version", "--version")
assert result.ret == 0
result.stderr.fnmatch_lines(["*This is pytest version*"])
if result.errlines:
version_out = result.stderr
else:
# Pytest 7.0+
version_out = result.stdout

version_out.fnmatch_lines(["*This is pytest version*"])

result = django_testdir.runpytest_subprocess("django_project_root", "--help")
assert result.ret == 0
Expand Down

0 comments on commit b9f9e92

Please sign in to comment.