Exemplo n.º 1
0
def MemTester(name):
        mem_at_start = free_mem()
        print("\n")
        show_mem("start test '%s' with" % name)
        yield
        missing = mem_at_start - free_mem()
        show_mem("end with")
        print("\n")
        assert missing <= 0.1* mem_at_start, "possible mem leak: %s at start, missing %s" % (mem_at_start, missing)
Exemplo n.º 2
0
def MemTester(name):
        mem_at_start = free_mem()
        print
        show_mem("start test '%s' with" % name)
        yield
        missing = mem_at_start - free_mem()
        show_mem("end with")
        print
        assert missing < 0.1* mem_at_start, "possible mem leak"
Exemplo n.º 3
0
def MemTester(name):
    mem_at_start = free_mem()
    print("\n")
    show_mem("start test '%s' with" % name)
    yield
    missing = mem_at_start - free_mem()
    show_mem("end with")
    print("\n")
    assert missing <= 0.1 * mem_at_start, "possible mem leak: %s at start, missing %s" % (
        mem_at_start, missing)
Exemplo n.º 4
0
        def tearDown(self):

            time.sleep(3)
            print("\n")
            show_mem("AT THE END ")
            print("\n")
            missing = self.mem_at_start - free_mem()
            assert missing <= 0.1* self.mem_at_start, "possible mem leak: %s at start, missing %s" % (self.mem_at_start, missing)
Exemplo n.º 5
0
        def tearDown(self):

            time.sleep(3)
            print
            show_mem("AT THE END ")
            print
            missing = self.mem_at_start - free_mem()
            assert missing < 0.1* self.mem_at_start, "possible mem leak"
Exemplo n.º 6
0
        def tearDown(self):

            time.sleep(3)
            print("\n")
            show_mem("AT THE END ")
            print("\n")
            missing = self.mem_at_start - free_mem()
            assert missing <= 0.1 * self.mem_at_start, "possible mem leak: %s at start, missing %s" % (
                self.mem_at_start, missing)
Exemplo n.º 7
0
        def setUp(self):
            self.mem_at_start = free_mem()

            print("\n")
            show_mem("AT THE BEGINNING ")
            print("\n")

            dirname = os.path.dirname(os.path.abspath(__file__))
            self.testfile = os.path.join(dirname, "../test.mzXML").encode()
Exemplo n.º 8
0
        def setUp(self):
            self.mem_at_start = free_mem()

            print("\n")
            show_mem("AT THE BEGINNING ")
            print("\n")

            dirname = os.path.dirname(os.path.abspath(__file__))
            self.testfile = os.path.join(dirname, "../test.mzXML").encode()
Exemplo n.º 9
0
def show_mem(label):

    p = free_mem()
    p /= 1024.0 * 1024
    print((label + " ").ljust(50, "."), ": %8.2f MB" % p)
    sys.stdout.flush()
Exemplo n.º 10
0
def show_mem(label):

    p = free_mem()
    p /= 1024.0 * 1024
    print((label+" ").ljust(50, "."), ": %8.2f MB" % p)
    sys.stdout.flush()
Exemplo n.º 11
0
        def setUp(self):
            self.mem_at_start = free_mem()

            print
            show_mem("AT THE BEGINNING ")
            print