X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=tests%2Fbase_test.py;h=dc606cc7feb8cca9ed6b259db65c84a2007f257b;hb=c11e2b4f33f57e89d02e55a9216f9ae6f91b18ca;hp=255e71b001a537e94be3d73609f152ce69d3f785;hpb=682635f59f5271a071418e1eb6ccf0c3b3247c28;p=dak.git diff --git a/tests/base_test.py b/tests/base_test.py index 255e71b0..dc606cc7 100644 --- a/tests/base_test.py +++ b/tests/base_test.py @@ -1,18 +1,36 @@ import os import sys import unittest +import warnings from os.path import abspath, dirname, join DAK_ROOT_DIR = dirname(dirname(abspath(__file__))) -DAK_TEST_FIXTURES = join(DAK_ROOT_DIR, 'tests', 'fixtures') + +# suppress some deprecation warnings in squeeze related to apt_pkg, +# debian, and md5 modules +warnings.filterwarnings('ignore', \ + "Attribute '.*' of the 'apt_pkg\.Configuration' object is deprecated, use '.*' instead\.", \ + DeprecationWarning) +warnings.filterwarnings('ignore', \ + "apt_pkg\.newConfiguration\(\) is deprecated\. Use apt_pkg\.Configuration\(\) instead\.", \ + DeprecationWarning) +warnings.filterwarnings('ignore', \ + "please use 'debian' instead of 'debian_bundle'", \ + DeprecationWarning) +warnings.filterwarnings('ignore', \ + "the md5 module is deprecated; use hashlib instead", \ + DeprecationWarning) class DakTestCase(unittest.TestCase): def setUp(self): pass +def fixture(*dirs): + return join(DAK_ROOT_DIR, 'tests', 'fixtures', *dirs) + os.environ['DAK_TEST'] = '1' -os.environ['DAK_CONFIG'] = join(DAK_TEST_FIXTURES, 'dak.conf') +os.environ['DAK_CONFIG'] = fixture('dak.conf') if DAK_ROOT_DIR not in sys.path: sys.path.insert(0, DAK_ROOT_DIR)