summaryrefslogtreecommitdiff
path: root/tests/memleak.py
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-07-17 19:40:47 +0200
committerJulian Andres Klode <jak@debian.org>2009-07-17 19:40:47 +0200
commitcbd822c9dfe8cf18d828bd558290f15775b4d837 (patch)
treeb9ee1d702dd85a5dc2cbd9303e7f31ca6b8ffa52 /tests/memleak.py
parent9bd7c1dcf9942d6ce294aa5ac58d90d6c1aa9f51 (diff)
downloadpython-apt-cbd822c9dfe8cf18d828bd558290f15775b4d837.tar.gz
tests: First work on the new testsuite.
The module tests.test_all will run all available tests. Each test placed herein must be using unittest and provide at least 1 test case. It must be prefixed with test_.
Diffstat (limited to 'tests/memleak.py')
-rwxr-xr-xtests/memleak.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/tests/memleak.py b/tests/memleak.py
deleted file mode 100755
index 5299f35f..00000000
--- a/tests/memleak.py
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/python
-
-import apt
-import apt_pkg
-import time
-import gc
-import sys
-
-
-cache = apt.Cache()
-
-# memleak
-for i in range(100):
- cache.open(None)
- print cache["apt"].name
- time.sleep(1)
- gc.collect()
- f = open("%s" % i, "w")
- for obj in gc.get_objects():
- f.write("%s\n" % str(obj))
- f.close()
-
-# memleak
-#for i in range(100):
-# cache = apt.Cache()
-# time.sleep(1)
-# cache = None
-# gc.collect()
-
-# no memleak, but more or less the apt.Cache.open() code
-for i in range(100):
- cache = apt_pkg.Cache()
- depcache = apt_pkg.DepCache(cache)
- records = apt_pkg.PackageRecords(cache)
- list = apt_pkg.SourceList()
- list.ReadMainList()
- dict = {}
- for pkg in cache.Packages:
- if len(pkg.VersionList) > 0:
- dict[pkg.Name] = apt.Package(cache, depcache,
- records, list, None, pkg)
-
- print cache["apt"]
- time.sleep(1)
-
- gc.collect()