def mktemp(self): """ Pathetic substitute for twisted.trial.unittest.TestCase.mktemp. """ if self._temporaryFiles is None: self._temporaryFiles = [] temp = b(mktemp(dir=".")) self._temporaryFiles.append(temp) return temp
import pytest from six import PY3 from OpenSSL._util import exception_from_error_queue from OpenSSL.crypto import Error from . import memdbg from OpenSSL._util import ffi, lib, byte_string as b # This is the UTF-8 encoding of the SNOWMAN unicode code point. NON_ASCII = b("\xe2\x98\x83").decode("utf-8") class TestCase(TestCase): """ :py:class:`TestCase` adds useful testing functionality beyond what is available from the standard library :py:class:`unittest.TestCase`. """ def run(self, result): run = super(TestCase, self).run if memdbg.heap is None: return run(result) # Run the test as usual before = set(memdbg.heap)
from OpenSSL._util import exception_from_error_queue from OpenSSL.crypto import Error try: import memdbg except Exception: class _memdbg(object): heap = None memdbg = _memdbg() from OpenSSL._util import ffi, lib, byte_string as b # This is the UTF-8 encoding of the SNOWMAN unicode code point. NON_ASCII = b("\xe2\x98\x83").decode("utf-8") class TestCase(TestCase): """ :py:class:`TestCase` adds useful testing functionality beyond what is available from the standard library :py:class:`unittest.TestCase`. """ def run(self, result): run = super(TestCase, self).run if memdbg.heap is None: return run(result) # Run the test as usual before = set(memdbg.heap) run(result)