Skip to content
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

TestExceptionInfo.test_traceback_not_referenced fails with pypy3 #442

Closed
mgorny opened this issue May 27, 2020 · 2 comments
Closed

TestExceptionInfo.test_traceback_not_referenced fails with pypy3 #442

mgorny opened this issue May 27, 2020 · 2 comments

Comments

@mgorny
Copy link

mgorny commented May 27, 2020

Describe the bug
TestExceptionInfo.test_traceback_not_referenced fails when the test suite is run using PyPy3:

_________________________________________________ TestExceptionInfo.test_traceback_not_referenced _________________________________________________

self = <test_errors.TestExceptionInfo object at 0x00007fb05c3fbb40>

    def test_traceback_not_referenced(self):
        """
        Ensure that an ExceptionInfo does not keep a reference
        to the traceback, as doing so can create unintended
        side effects. See #386 for more info.
        """
        state = mock.MagicMock()
        _ = errors.ExceptionInfo(None, None, DeletionDetector(state))
>       assert state.deleted
E       AssertionError: assert False
E        +  where False = <MagicMock id='140395438949168'>.deleted

tests/test_errors.py:24: AssertionError

To Reproduce
Steps to reproduce the behavior:

  1. Install dependencies for pypy3 (tox doesn't seem to work here, I used distribution packages)
  2. pypy3 -m pytest

Expected behavior
All tests passing.

Environment

  • OS: Gentoo Linux
$ pypy3 --version
Python 3.6.9 (?, Apr 10 2020, 20:05:19)
[PyPy 7.3.1 with GCC 9.2.0]

Run from git master (fb74a37).

Additional context
My guess would be that it's due to different GC behavior in PyPy.

@jaraco
Copy link
Owner

jaraco commented Aug 22, 2020

`tox` doesn't seem to work here

This finding was a surprise to me. So it seems that neither black no mypy install on pypy (due to python/typed_ast#111). I've reached out to the typing team on gitter to see how permanent that condition is.

@jaraco
Copy link
Owner

jaraco commented Sep 8, 2020

I've merged 15f6272, which addresses the tox issue.

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

No branches or pull requests

2 participants