Ciao a tutti, sto utilizzando le doctest per la mia documentazione... solo che il NORMALIZE_WHITESPACE, mi funziona solo con le liste e non con i dizionari...
in un file test.py ho scritto: # test.py """ >>> a = range(9) >>> a #doctest: +NORMALIZE_WHITESPACE [0, 1, 2, 3, 4, 5, 6, 7, 8] >>> z = {'a':0, 'b':1, 'c':2, 'd':3,} >>> z #doctest: +NORMALIZE_WHITESPACE {'a' : 0, 'b' : 1, 'c' : 2, 'd' : 3} """ se lo eseguo con: $ python2 -m doctest test.py -v Trying: a = range(9) Expecting nothing ok Trying: a #doctest: +NORMALIZE_WHITESPACE Expecting: [0, 1, 2, 3, 4, 5, 6, 7, 8] ok Trying: z = {'a':0, 'b':1, 'c':2, 'd':3,} Expecting nothing ok Trying: z #doctest: +NORMALIZE_WHITESPACE Expecting: {'a' : 0, 'b' : 1, 'c' : 2, 'd' :3} ********************************************************************** File "test.py", line 8, in test Failed example: z #doctest: +NORMALIZE_WHITESPACE Expected: {'a' : 0, 'b' : 1, 'c' : 2, 'd' :3} Got: {'a': 0, 'c': 2, 'b': 1, 'd': 3} ********************************************************************** 1 items had failures: 1 of 4 in test 4 tests in 1 items. 3 passed and 1 failed. ***Test Failed*** 1 failures. cosa sto sbagliando? grazie a tutti per l'aiuto! Pietro _______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python