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

Memleak nose plugin does not work on python 3 #662

Closed
jbarnoud opened this issue Jan 26, 2016 · 3 comments
Closed

Memleak nose plugin does not work on python 3 #662

jbarnoud opened this issue Jan 26, 2016 · 3 comments
Assignees
Labels

Comments

@jbarnoud
Copy link
Contributor

When running the tests on python 3 with the memleak plugin activated (see #658), all tests error with a traceback similar to:

Traceback (most recent call last):
  File "/home/jon/Envs/mda3/lib/python3.4/site-packages/nose/case.py", line 134, in run
    self.runTest(result)
  File "/home/jon/Envs/mda3/lib/python3.4/site-packages/nose/case.py", line 152, in runTest
    test(result)
  File "/usr/lib/python3.4/unittest/case.py", line 625, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib/python3.4/unittest/case.py", line 553, in run
    result.startTest(self)
  File "/home/jon/Envs/mda3/lib/python3.4/site-packages/nose/proxy.py", line 169, in startTest
    self.plugins.startTest(self.test)
  File "/home/jon/Envs/mda3/lib/python3.4/site-packages/nose/plugins/manager.py", line 99, in __call__
    return self.call(*arg, **kw)
  File "/home/jon/Envs/mda3/lib/python3.4/site-packages/nose/plugins/manager.py", line 167, in simple
    result = meth(*arg, **kw)
  File "/home/jon/dev/mdanalysis/testsuite/MDAnalysisTests/plugins/memleak.py", line 68, in startTest
    rp = test.test._resultForDoCleanups
AttributeError: 'MethodTestCase' object has no attribute '_resultForDoCleanups'
@kain88-de
Copy link
Member

Is there an option run those test inside of ipython and into the debugger when the attributeError occurs?

@jbarnoud
Copy link
Contributor Author

I found
http://stackoverflow.com/questions/4950637/setting-breakpoints-with-nosetests-pdb-option
but I do not know how it applies in that case.

On 26-01-16 12:06, kain88-de wrote:

Is there an option run those test inside of ipython and into the
debugger when the attributeError occurs?


Reply to this email directly or view it on GitHub
#662 (comment).

@mnmelo mnmelo self-assigned this Jan 26, 2016
@mnmelo
Copy link
Member

mnmelo commented Jan 27, 2016

Ok, fixed the problem. I actually found a much better way to register the memleak test hook, and the plugin is now much more elegant.

On the other hand, as explained in PEP 442, from python 3.4 onward leaks from circular references are now cleanly handled. It seems we won't be needing my (now beautiful) plugin with python 3 😢

richardjgowers added a commit that referenced this issue Jan 27, 2016
Made memleak testing python 3 compliant (closes #662)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants