Message36569
Some times it is helpful to know the directory that
tests are being run from so that they can collect
their test data. If for example you have a parser and
some test files finding those file reguardless of how
the test is called is helpful to the test author.
TestCase has been extended to allow for this. When a
testCase instance needs to find a data file relative
to itself it can now say
class TestFoo(TestCase):
def checkFoo(self):
dirname = self.getPath()
# or
filename = self.getPath("foo.data")
If TestFoo.py is in /home/user/python/tests then
dirname == /home/user/python/tests
and
filename == /home/user/python/tests/foo.data
There is not cost if this feature is not invoked. |
|
Date |
User |
Action |
Args |
2007-08-23 15:05:41 | admin | link | issue423224 messages |
2007-08-23 15:05:41 | admin | create | |
|