Skip to content

Test failures with Python 3.2 and PYTHONWARNINGS="d" #2083

Closed
Arfrever opened this Issue Jul 2, 2012 · 1 comment

3 participants

@Arfrever
Arfrever commented Jul 2, 2012

When PYTHONWARNINGS="d" environmental variable is set, then some tests fail with Python 3.2 due to ResourceWarnings triggered by tests:

======================================================================
ERROR: test_startup_ipy (IPython.core.tests.test_profile.ProfileStartupTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/testing/decorators.py", line 229, in skipper_func
    return f(*args, **kwargs)
  File "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/core/tests/test_profile.py", line 118, in test_startup_ipy
    self.validate('test')
  File "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/core/tests/test_profile.py", line 107, in validate
    tt.ipexec_validate(self.fname, output, '', options=self.options)
  File "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/testing/tools.py", line 262, in ipexec_validate
    (fname, err))
ValueError: Running file '/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tmpm3zkzw/test.py' produced error: "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/utils/py3compat.py:76: ResourceWarning: unclosed file <_io.BufferedReader name='/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tmpm3zkzw/test.py'>\n  exec(compile(open(fname, 'rb').read(), fname, 'exec'), glob, loc)\n"

======================================================================
ERROR: test_startup_py (IPython.core.tests.test_profile.ProfileStartupTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/testing/decorators.py", line 229, in skipper_func
    return f(*args, **kwargs)
  File "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/core/tests/test_profile.py", line 113, in test_startup_py
    self.validate('123')
  File "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/core/tests/test_profile.py", line 107, in validate
    tt.ipexec_validate(self.fname, output, '', options=self.options)
  File "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/testing/tools.py", line 262, in ipexec_validate
    (fname, err))
ValueError: Running file '/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tmpm3zkzw/test.py' produced error: "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/utils/py3compat.py:76: ResourceWarning: unclosed file <_io.BufferedReader name='/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tmpm3zkzw/home_test_dir/.ipython/profile_test/startup/00-start.py'>\n  exec(compile(open(fname, 'rb').read(), fname, 'exec'), glob, loc)\n/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/utils/py3compat.py:76: ResourceWarning: unclosed file <_io.BufferedReader name='/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tmpm3zkzw/test.py'>\n  exec(compile(open(fname, 'rb').read(), fname, 'exec'), glob, loc)\n"

======================================================================
ERROR: IPython.core.tests.test_run.TestMagicRunSimple.test_obj_del
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.2/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/core/tests/test_run.py", line 189, in test_obj_del
    tt.ipexec_validate(self.fname, 'object A deleted', err)
  File "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/testing/tools.py", line 262, in ipexec_validate
    (fname, err))
ValueError: Running file '/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tmpnm9d2n.py' produced error: "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/utils/py3compat.py:76: ResourceWarning: unclosed file <_io.BufferedReader name='/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tmpnm9d2n.py'>\n  exec(compile(open(fname, 'rb').read(), fname, 'exec'), glob, loc)\n"

======================================================================
ERROR: IPython.core.tests.test_run.TestMagicRunSimple.test_tclass
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.2/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/testing/decorators.py", line 229, in skipper_func
    return f(*args, **kwargs)
  File "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/core/tests/test_run.py", line 231, in test_tclass
    tt.ipexec_validate(self.fname, out, err)
  File "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/testing/tools.py", line 262, in ipexec_validate
    (fname, err))
ValueError: Running file '/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tmp0a9rah.ipy' produced error: "/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/utils/py3compat.py:76: ResourceWarning: unclosed file <_io.BufferedReader name='/var/tmp/portage/dev-python/ipython-0.13-r1000/temp/tests-3.2/usr/lib64/python3.2/site-packages/IPython/core/tests/tclass.py'>\n  exec(compile(open(fname, 'rb').read(), fname, 'exec'), glob, loc)\n"

----------------------------------------------------------------------
Ran 340 tests in 22.876s

FAILED (KNOWNFAIL=1, SKIP=1, errors=4)
**********************************************************************
@fperez
IPython member
fperez commented Jul 2, 2012

Thanks for the report!

@takluyver takluyver closed this in b1a8e9d Jul 4, 2012
@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
@bfroehle bfroehle Fix Python 3.2 test failures (ResourceWarnings from unclosed files).
Closes gh-2083.
0fc30ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.