Skip to content

self-tests fail against Pytest 7 #995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stanislavlevin opened this issue Feb 28, 2022 · 0 comments · Fixed by #996
Closed

self-tests fail against Pytest 7 #995

stanislavlevin opened this issue Feb 28, 2022 · 0 comments · Fixed by #996

Comments

@stanislavlevin
Copy link
Contributor

1 test fails on migration to Pytest 7:

=================================== FAILURES ===================================
______________ test_django_project_found_invalid_settings_version ______________

django_testdir = <Testdir local('/usr/src/tmp/pytest-of-builder/pytest-0/test_django_project_found_invalid_settings_version0')>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f2af96481f0>

    @pytest.mark.django_project(project_root="django_project_root", create_manage_py=True)
    def test_django_project_found_invalid_settings_version(django_testdir, monkeypatch) -> None:
        """Invalid DSM should not cause an error with --help or --version."""
        monkeypatch.setenv("DJANGO_SETTINGS_MODULE", "DOES_NOT_EXIST")
    
        result = django_testdir.runpytest_subprocess("django_project_root", "--version", "--version")
        assert result.ret == 0
>       result.stderr.fnmatch_lines(["*This is pytest version*"])
E       Failed: remains unmatched: '*This is pytest version*'

/usr/src/RPM/BUILD/python3-module-pytest-django-4.5.2/tests/test_manage_py_scan.py:121: Failed
----------------------------- Captured stdout call -----------------------------
running: /usr/src/RPM/BUILD/python3-module-pytest-django-4.5.2/.tox/py3/bin/python -mpytest --basetemp=/usr/src/tmp/pytest-of-builder/pytest-0/test_django_project_found_invalid_settings_version0/runpytest-0 django_project_root --version --version
     in: /usr/src/tmp/pytest-of-builder/pytest-0/test_django_project_found_invalid_settings_version0
This is pytest version 7.0.1, imported from /usr/lib/python3/site-packages/pytest/__init__.py
setuptools registered plugins:
  pytest-django-4.5.2 at /usr/src/RPM/BUILD/python3-module-pytest-django-4.5.2/pytest_django/plugin.py

https://docs.pytest.org/en/7.0.x/changelog.html#breaking-changes:

pytest#8246: --version now writes version information to stdout rather than stderr.

stanislavlevin added a commit to stanislavlevin/pytest-django that referenced this issue Feb 28, 2022
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 <[email protected]>
stanislavlevin added a commit to stanislavlevin/pytest-django that referenced this issue Feb 28, 2022
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 <[email protected]>
stanislavlevin added a commit to stanislavlevin/pytest-django that referenced this issue Feb 28, 2022
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 <[email protected]>
bluetech pushed a commit that referenced this issue Feb 28, 2022
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]>
beyondgeeks pushed a commit to beyondgeeks/django-pytest that referenced this issue Sep 6, 2022
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/pytest-django#995
Signed-off-by: Stanislav Levin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant