def setup(self): """Setup each instance, patching necissary bits.""" self._test = opengl.WflInfo() self.__patchers.append( mock.patch.dict('framework.test.opengl.OPTIONS.env', {'PIGLIT_PLATFORM': 'foo'})) self.__patchers.append( mock.patch('framework.test.opengl.WflInfo._WflInfo__shared_state', {})) for f in self.__patchers: f.start()
def setup_class(cls): """Setup each instance, patching necissary bits.""" cls._test = opengl.WflInfo() cls.__patchers.append( mock.patch.dict('framework.test.opengl.OPTIONS.env', {'PIGLIT_PLATFORM': 'foo'})) rv = textwrap.dedent("""\ Waffle platform: glx Waffle api: gles3 OpenGL vendor string: WFLINFO_GL_ERROR OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile OpenGL version string: WFLINFO_GL_ERROR OpenGL context flags: 0x0\n OpenGL shading language version string: WFLINFO_GL_ERROR OpenGL extensions: WFLINFO_GL_ERROR """).encode('utf-8') cls.__patchers.append( mock.patch('framework.test.opengl.subprocess.check_output', mock.Mock(return_value=rv))) for f in cls.__patchers: f.start()
def setup(self): """Setup each instance, patching necissary bits.""" self._test = opengl.WflInfo()
def inst(self): return opengl.WflInfo()
def setup(self): self.inst = opengl.WflInfo()