~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/testing/__init__.py

[r=allenap][no-qa] From YUIUnitTestCase.id() return a normalized test
        case path relative to config.root.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
    'ZopeTestInSubProcess',
51
51
    ]
52
52
 
 
53
from contextlib import contextmanager
53
54
from cStringIO import StringIO
54
 
from contextlib import contextmanager
55
55
from datetime import (
56
56
    datetime,
57
57
    timedelta,
74
74
import time
75
75
import unittest
76
76
 
77
 
import simplejson
78
 
 
79
77
from bzrlib import trace
80
78
from bzrlib.bzrdir import (
81
79
    BzrDir,
84
82
from bzrlib.transport import get_transport
85
83
import fixtures
86
84
import pytz
 
85
import simplejson
87
86
from storm.expr import Variable
88
87
from storm.store import Store
89
88
from storm.tracer import (
546
545
        The config values will be restored during test tearDown.
547
546
        """
548
547
        name = self.factory.getUniqueString()
549
 
        body = '\n'.join(["%s: %s" % (k, v) for k, v in kwargs.iteritems()])
 
548
        body = '\n'.join("%s: %s" % (k, v) for k, v in kwargs.iteritems())
550
549
        config.push(name, "\n[%s]\n%s\n" % (section, body))
551
550
        self.addCleanup(config.pop, name)
552
551
 
861
860
 
862
861
    def id(self):
863
862
        """Return an ID for this test based on the file path."""
864
 
        return self.test_path
 
863
        return os.path.relpath(self.test_path, config.root)
865
864
 
866
865
    def setUp(self):
867
866
        super(YUIUnitTestCase, self).setUp()