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 0056712
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_manage_py_scan.py
Expand Up @@ -118,7 +118,12 @@ 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 hasattr(pytest, "version_tuple") and pytest.version_tuple >= (7, 0):
version_out = result.stdout
else:
version_out = result.stderr

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 0056712

Please sign in to comment.