[pitivi] Add an env variable to turn off reference leaks.
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pitivi] Add an env variable to turn off reference leaks.
- Date: Sat, 29 Aug 2009 08:33:54 +0000 (UTC)
commit 2a7a7945a92e068be928d609ddef05205f2ee492
Author: Alessandro Decina <alessandro d gmail com>
Date: Thu Aug 27 14:55:31 2009 +0200
Add an env variable to turn off reference leaks.
tests/common.py | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/tests/common.py b/tests/common.py
index 6ff05ec..e4db30f 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -5,11 +5,14 @@ A collection of objects to use for testing
import gobject
gobject.threads_init()
import gst
+import os
import gc
import unittest
from pitivi.factories.base import ObjectFactory, SourceFactory, SinkFactory
from pitivi.pipeline import Pipeline
+detect_leaks = os.environ.get("PITIVI_TEST_DETECT_LEAKS", "1") not in ("0", "")
+
class TestCase(unittest.TestCase):
_tracked_types = (gst.MiniObject, gst.Element, gst.Pad, gst.Caps,
ObjectFactory, Pipeline)
@@ -55,11 +58,13 @@ class TestCase(unittest.TestCase):
del self._tracked
def setUp(self):
- self.gctrack()
+ if detect_leaks:
+ self.gctrack()
def tearDown(self):
- self.gccollect()
- self.gcverify()
+ if detect_leaks:
+ self.gccollect()
+ self.gcverify()
# Some fake factories
class FakeSourceFactory(SourceFactory):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]