[Zope-Coders] Re: [Zope-Checkins] CVS: Zope/lib/python/DateTime/tests - testDateTime.py:1.12.6.3

Tres Seaver tseaver@zope.com
17 Oct 2002 10:13:54 -0400


On Thu, 2002-10-17 at 06:20, Torped Strategy and Communications wrote:
> Update of /cvs-repository/Zope/lib/python/DateTime/tests
> In directory cvs.zope.org:/tmp/cvs-serv466/lib/python/DateTime/tests
> 
> Modified Files:
>       Tag: Zope-2_6-branch
> 	testDateTime.py 
> Log Message:
> Made the testJulianWeek work again.

Depending on the current working directory means that the tests can only
be run from one place (and probably the wrong one)!  Why aren't we using
the '__file__' of the module to figure out where the test data is?

> 
> === Zope/lib/python/DateTime/tests/testDateTime.py 1.12.6.2 => 1.12.6.3 ===
> --- Zope/lib/python/DateTime/tests/testDateTime.py:1.12.6.2	Tue Oct 15 22:22:06 2002
> +++ Zope/lib/python/DateTime/tests/testDateTime.py	Thu Oct 17 06:20:15 2002
> @@ -2,12 +2,14 @@
>  # To run these tests, use:
>  #   python unittest.py DateTime.tests.suite
>  
> -import os
>  import unittest
>  from DateTime import DateTime
>  import string
>  import math
>  import time
> +
> +import os
> +__basedir__ = os.getcwd()
>  
>  class DateTimeTests (unittest.TestCase):

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com