[ditrack commit] r1380 - src/trunk/tests/dttest

Vlad Skvortsov vss at 73rus.com
Mon Mar 5 14:12:03 PST 2007


gli at ditrack.org wrote:
> Author: gli
> Date: 2007-03-05 00:49:28 -0800 (Mon, 05 Mar 2007)
> New Revision: 1380
>
> Modified:
>    src/trunk/tests/dttest/dttest.py
> Log:
> fixing i#80. environment variable DITRACK_ROOT messes up the test suite
>
> Modified: src/trunk/tests/dttest/dttest.py
> ===================================================================
> --- src/trunk/tests/dttest/dttest.py	2007-03-03 13:35:18 UTC (rev 1379)
> +++ src/trunk/tests/dttest/dttest.py	2007-03-05 08:49:28 UTC (rev 1380)
> @@ -76,6 +76,9 @@
>          specified in the parameter and extracts the issue database into a
>          working copy.
>          """
> +        # i#80. DITRACK_ROOT messes up the test suite
> +        if os.environ.has_key('DITRACK_ROOT'):
> +            del (os.environ['DITRACK_ROOT'])
>  
>          self.repo = repo
>  
>   

Hmm. What this actually does is it masks the condition. I was thinking 
about the case where we need to use DITRACK_ROOT in a test. So we can't 
just wipe its value from the environment. However, we don't have such 
testcases at the moment (or do we?), so I don't have exact suggestion in 
mind right now. Anyway, instead of silently removing it, I'd prefer to

assert "DITRACK_ROOT" not in os.environ, "We don't know how to handle 
DITRACK_ROOT yet!"

Also note the usage of double quotes.

-- 
Vlad Skvortsov, vss at 73rus.com, http://vss.73rus.com



More information about the Dev mailing list