[issue11049] add tests for test.support

Giampaolo Rodola' report at bugs.python.org
Sat Jan 29 15:41:05 CET 2011


Giampaolo Rodola' <g.rodola at gmail.com> added the comment:

> * class TestCase(unittest.TestCase): -> why not give the test class a 
> more useful name?

done

> * import_fresh_module is tested similarly to import_module - can't a 
> test be added that it indeed performs its "special sauce"?

Even by reading the source code I'm not sure what import_fresh_module does exactly.
Feel free to write a test for it if you want.

> * test_DirsOnSysPath: you may want to use assertIn and assertNotIn here. [these 
> were added to Python in 3.1]

done

> * test_python_is_optimized: you may want to use assertIsInstance here.

done

> +        os.mkdir(os.path.join(TESTFN, TESTFN))
> Please don't. This will break the day TESTFN becomes a non-trivial path.

done

> You should also check that the errno is EBADF.

Done. I just hope it's gonna be reliable on all platforms.

----------
Added file: http://bugs.python.org/file20602/test_support.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11049>
_______________________________________


More information about the Python-bugs-list mailing list