On 11/11/2014 01:46 PM, Albert-Jan Roskam wrote:
Ethan Furman wrote:

I don't know, haven't used it nor read the code.  It would certainly not
be good if it failed in optimized mode.

antonia@antonia-HP-2133 /tmp $ python -O test.py
Ran 2 tests in 0.015s
OK

antonia@antonia-HP-2133 /tmp $ python -O -m nose test.py
Ran 2 tests in 0.003s
OK

antonia@antonia-HP-2133 /tmp $ python test.py
Ran 2 tests in 0.044s
FAILED (failures=2)

antonia@antonia-HP-2133 /tmp $ python -m nose test.py
Ran 2 tests in 0.044s
FAILED (failures=2)

antonia@antonia-HP-2133 /tmp $ nosetests -O -v test.py
Usage: nosetests [options]

nosetests: error: no such option: -O   # phweeew

In other words, nose the module doesn't handle optimized mode, and apparently 
nosetests cannot run in optimized mode.

On the other hand, unittest:
--------------------------------------
from unittest import TestCase, main

class TestTest(TestCase):
    def test_optimized(self):
        self.assertTrue(1 == 2)

if __name__ == '__main__':
    main()
--------------------------------------

ethan@media:~/source$ python3.4 test.py
Ran 1 test in 0.001s
FAILED (failures=1)

ethan@media:~/source$ python3.4 -O test.py
Ran 1 test in 0.001s
FAILED (failures=1)


I'll stick with unittest.

--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to