bro
This commit is contained in:
1 parent
de41a02749
commit
9af09cebd3
764 files changed
+54218
-78859
No files matched your search
@@ -1,7 +1,8 @@
|
||||
import platform
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
import platform
|
||||
|
||||
IS_PYPY = "PyPy" == platform.python_implementation()
|
||||
|
||||
try:
|
||||
@@ -10,6 +11,7 @@ except NameError:
|
||||
pass
|
||||
import pygame
|
||||
|
||||
|
||||
quit_count = 0
|
||||
|
||||
|
||||
@@ -113,8 +115,7 @@ class BaseModuleTest(unittest.TestCase):
|
||||
# verified by first checking the weak reference both before and
|
||||
# after the regular reference held by o is removed.
|
||||
|
||||
import gc
|
||||
import weakref
|
||||
import weakref, gc
|
||||
|
||||
class NoDictError(RuntimeError):
|
||||
pass
|
||||
@@ -192,7 +193,8 @@ class BaseModuleTest(unittest.TestCase):
|
||||
o = Exporter(shape, typechar, itemsize)
|
||||
self.assertEqual(getrefcount(o.__array_struct__), 1)
|
||||
|
||||
from pygame.tests.test_utils import buftools
|
||||
if pygame.HAVE_NEWBUF:
|
||||
from pygame.tests.test_utils import buftools
|
||||
|
||||
def NEWBUF_assertSame(self, proxy, exp):
|
||||
buftools = self.buftools
|
||||
@@ -207,6 +209,7 @@ class BaseModuleTest(unittest.TestCase):
|
||||
self.assertEqual(imp.strides, exp.strides)
|
||||
self.assertTrue(imp.suboffsets is None)
|
||||
|
||||
@unittest.skipIf(not pygame.HAVE_NEWBUF, "newbuf not implemented")
|
||||
@unittest.skipIf(IS_PYPY, "pypy no likey")
|
||||
def test_newbuf(self):
|
||||
from pygame.bufferproxy import BufferProxy
|
||||
@@ -247,11 +250,11 @@ class BaseModuleTest(unittest.TestCase):
|
||||
v = BufferProxy(o)
|
||||
self.NEWBUF_assertSame(v, o)
|
||||
|
||||
@unittest.skipIf(not pygame.HAVE_NEWBUF, "newbuf not implemented")
|
||||
def test_bad_format(self):
|
||||
from ctypes import addressof, create_string_buffer
|
||||
|
||||
from pygame.bufferproxy import BufferProxy
|
||||
from pygame.newbuffer import BufferMixin
|
||||
from ctypes import create_string_buffer, addressof
|
||||
|
||||
buftools = self.buftools
|
||||
Exporter = buftools.Exporter
|
||||
@@ -277,6 +280,7 @@ class BaseModuleTest(unittest.TestCase):
|
||||
b = BufferProxy(exp)
|
||||
self.assertRaises(ValueError, Importer, b, PyBUF_FORMAT)
|
||||
|
||||
@unittest.skipIf(not pygame.HAVE_NEWBUF, "newbuf not implemented")
|
||||
@unittest.skipIf(IS_PYPY, "fails on pypy")
|
||||
def test_PgDict_AsBuffer_PyBUF_flags(self):
|
||||
from pygame.bufferproxy import BufferProxy
|
||||
@@ -378,11 +382,10 @@ class BaseModuleTest(unittest.TestCase):
|
||||
self.assertEqual(b.buf, 1000000)
|
||||
self.assertRaises(BufferError, Importer, a, buftools.PyBUF_FULL)
|
||||
|
||||
@unittest.skipIf(IS_PYPY, "newbuf with ctypes")
|
||||
@unittest.skipIf(IS_PYPY or (not pygame.HAVE_NEWBUF), "newbuf with ctypes")
|
||||
def test_PgObject_AsBuffer_PyBUF_flags(self):
|
||||
import ctypes
|
||||
|
||||
from pygame.bufferproxy import BufferProxy
|
||||
import ctypes
|
||||
|
||||
is_lil_endian = pygame.get_sdl_byteorder() == pygame.LIL_ENDIAN
|
||||
fsys, frev = ("<", ">") if is_lil_endian else (">", "<")
|
||||
@@ -507,6 +510,7 @@ class BaseModuleTest(unittest.TestCase):
|
||||
# Scrap is optional.
|
||||
pass
|
||||
|
||||
# pygame.cdrom
|
||||
# pygame.joystick
|
||||
|
||||
def init_assertions(self):
|
||||
|
||||
Reference in new issue
Block a user