def test_debug_logging(): """Test advanced debugging logging""" with use_log_level('debug', 'Selected', True) as l: a = app.Application() a.use() a.quit() assert_equal(len(l), 1) assert_in('vispy.app.application', l[0]) with use_log_level('debug', record=True) as l: a = app.Application() a.use() a.quit() assert_equal(len(l), 1) assert_in('vispy.app.application', l[0]) with use_log_level('debug', 'foo', True) as l: a = app.Application() a.use() a.quit() assert_equal(len(l), 0) with use_log_level('info', record=True) as l: a = app.Application() a.use() a.quit() assert_equal(len(l), 1) assert_not_in('vispy.app.application', l[0])
def test_import_vispy_app2(): """ Importing vispy.app should not pull in any backend toolkit. """ allmodnames = loaded_vispy_modules('vispy.app', 2, True) assert_not_in('PySide', allmodnames) assert_not_in('PyQt4', allmodnames) assert_not_in('pyglet', allmodnames) assert_not_in('OpenGL.GLUT', allmodnames)
def test_import_vispy_no_pyopengl(): """ Importing vispy.gloo.gl.desktop should not import PyOpenGL. """ allmodnames = loaded_vispy_modules('vispy.gloo.gl.desktop', 2, True) assert_not_in('OpenGL', allmodnames)