Commits

anatoly techtonik committed dcee118

tests/font: Port to Python 3, remove `from whatever import *` antipattern.

Comments (0)

Files changed (13)

tests/font/ADD_FONT.py

 
 from pyglet import font
 
-import base_text
+from . import base_text
 
 base_path = os.path.dirname(__file__)
 

tests/font/ALIGN_MULTILINE.py

 
 from pyglet import font
 
-import base_text
+from . import base_text
 
 class TEST_ALIGN_MULTILINE(base_text.TextTestBase):
     font_name = ''

tests/font/BULLET.py

 
 from pyglet import font
 
-import base_text
+from . import base_text
 
 class TEST_HALIGN(base_text.TextTestBase):
     font_name = ''

tests/font/COLOR.py

 __version__ = '$Id$'
 
 import unittest
-import base_text
+from . import base_text
 
 from pyglet import font
 

tests/font/COLOR_BLEND.py

 __version__ = '$Id$'
 
 import unittest
-import base_text
+from . import base_text
 
 from pyglet import font
 

tests/font/DEFAULT.py

 __version__ = '$Id: $'
 
 import unittest
-import base_text
+
+from . import base_text
 
 class TEST_DEFAULT(base_text.TextTestBase):
     font_name = ''

tests/font/HALIGN.py

 
 from pyglet import font
 
-import base_text
+from . import base_text
 
 class TEST_HALIGN(base_text.TextTestBase):
     font_name = ''

tests/font/HORIZONTAL_METRICS.py

 from pyglet.gl import *
 from pyglet import font
 
-import base_text
+from . import base_text
 
 base_path = os.path.dirname(__file__)
 

tests/font/SET_DPI.py

 from pyglet.gl import *
 from pyglet import font
 
-import base_text
+from . import base_text
 
 base_path = os.path.dirname(__file__)
 

tests/font/SYSTEM.py

 
 import unittest
 import sys
-import base_text
+from . import base_text
 
 if sys.platform == 'darwin':
     font_name = 'Helvetica'

tests/font/VALIGN.py

 from pyglet import gl
 from pyglet import font
 
-import base_text
+from . import base_text
 
 class TEST_VALIGN(base_text.TextTestBase):
     font_name = ''

tests/font/WRAP_INVARIANT.py

 __version__ = '$Id: $'
 
 import unittest
-import base_text
+from . import base_text
 from pyglet import font
 
 class TEST_WRAP_INVARIANT(base_text.TextTestBase):

tests/font/base_text.py

 import unittest
 import sys
 
-from pyglet.gl import *
+from pyglet import gl
 from pyglet import font
-from pyglet.window import *
-from pyglet.window.event import *
+from pyglet.window import Window
+from pyglet.window.event import key
 
 from tests.regression import ImageRegressionTestCase
 
             self.window.dispatch_event('on_close')
 
     def on_expose(self):
-        glClearColor(0.5, 0, 0, 1)
-        glClear(GL_COLOR_BUFFER_BIT)
-        glLoadIdentity()
+        gl.glClearColor(0.5, 0, 0, 1)
+        gl.glClear(gl.GL_COLOR_BUFFER_BIT)
+        gl.glLoadIdentity()
         self.draw()
         self.window.flip()