New submission from Antoine Pitrou:
$ ./python -m test -W -R3:3 test_statistics
[1/1] test_statistics
[...]
======================================================================
FAIL: assertApproxEqual (test.test_statistics.NumericTestCase)
Doctest: test.test_statistics.NumericTestCase.assertApproxEqual
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/doctest.py", line 2193, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for
test.test_statistics.NumericTestCase.assertApproxEqual
File "/home/antoine/cpython/default/Lib/test/test_statistics.py", line 153,
in assertApproxEqual
----------------------------------------------------------------------
File "/home/antoine/cpython/default/Lib/test/test_statistics.py", line 165, in
test.test_statistics.NumericTestCase.assertApproxEqual
Failed example:
class MyTest(NumericTestCase):
def test_number(self):
x = 1.0/6
y = sum([x]*6)
self.assertApproxEqual(y, 1.0, tol=1e-15)
def test_sequence(self):
a = [1.001, 1.001e-10, 1.001e10]
b = [1.0, 1e-10, 1e10]
self.assertApproxEqual(a, b, rel=1e-3)
Exception raised:
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/doctest.py", line 1324, in __run
compileflags, 1), test.globs)
File "<doctest
test.test_statistics.NumericTestCase.assertApproxEqual[0]>", line 1, in <module>
class MyTest(NumericTestCase):
NameError: name 'NumericTestCase' is not defined
----------------------------------------------------------------------
File "/home/antoine/cpython/default/Lib/test/test_statistics.py", line 177, in
test.test_statistics.NumericTestCase.assertApproxEqual
Failed example:
suite = unittest.TestLoader().loadTestsFromTestCase(MyTest)
Exception raised:
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/doctest.py", line 1324, in __run
compileflags, 1), test.globs)
File "<doctest
test.test_statistics.NumericTestCase.assertApproxEqual[3]>", line 1, in <module>
suite = unittest.TestLoader().loadTestsFromTestCase(MyTest)
NameError: name 'MyTest' is not defined
----------------------------------------------------------------------
File "/home/antoine/cpython/default/Lib/test/test_statistics.py", line 178, in
test.test_statistics.NumericTestCase.assertApproxEqual
Failed example:
unittest.TextTestRunner(stream=StringIO()).run(suite)
Exception raised:
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/doctest.py", line 1324, in __run
compileflags, 1), test.globs)
File "<doctest
test.test_statistics.NumericTestCase.assertApproxEqual[4]>", line 1, in <module>
unittest.TextTestRunner(stream=StringIO()).run(suite)
NameError: name 'suite' is not defined
======================================================================
FAIL: _DoNothing (test.test_statistics)
Doctest: test.test_statistics._DoNothing
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/doctest.py", line 2193, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for test.test_statistics._DoNothing
File "/home/antoine/cpython/default/Lib/test/test_statistics.py", line 99, in
_DoNothing
----------------------------------------------------------------------
File "/home/antoine/cpython/default/Lib/test/test_statistics.py", line 112, in
test.test_statistics._DoNothing
Failed example:
approx_equal(12.345, 12.346, tol=1e-3)
Exception raised:
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/doctest.py", line 1324, in __run
compileflags, 1), test.globs)
File "<doctest test.test_statistics._DoNothing[0]>", line 1, in <module>
approx_equal(12.345, 12.346, tol=1e-3)
NameError: name 'approx_equal' is not defined
----------------------------------------------------------------------
File "/home/antoine/cpython/default/Lib/test/test_statistics.py", line 114, in
test.test_statistics._DoNothing
Failed example:
approx_equal(12.345e6, 12.346e6, tol=1e-3) # tol is too small.
Exception raised:
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/doctest.py", line 1324, in __run
compileflags, 1), test.globs)
File "<doctest test.test_statistics._DoNothing[1]>", line 1, in <module>
approx_equal(12.345e6, 12.346e6, tol=1e-3) # tol is too small.
NameError: name 'approx_equal' is not defined
----------------------------------------------------------------------
File "/home/antoine/cpython/default/Lib/test/test_statistics.py", line 120, in
test.test_statistics._DoNothing
Failed example:
approx_equal(12.345, 12.346, rel=1e-4)
Exception raised:
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/doctest.py", line 1324, in __run
compileflags, 1), test.globs)
File "<doctest test.test_statistics._DoNothing[2]>", line 1, in <module>
approx_equal(12.345, 12.346, rel=1e-4)
NameError: name 'approx_equal' is not defined
----------------------------------------------------------------------
File "/home/antoine/cpython/default/Lib/test/test_statistics.py", line 122, in
test.test_statistics._DoNothing
Failed example:
approx_equal(12.345e6, 12.346e6, rel=1e-4)
Exception raised:
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/doctest.py", line 1324, in __run
compileflags, 1), test.globs)
File "<doctest test.test_statistics._DoNothing[3]>", line 1, in <module>
approx_equal(12.345e6, 12.346e6, rel=1e-4)
NameError: name 'approx_equal' is not defined
----------------------------------------------------------------------
File "/home/antoine/cpython/default/Lib/test/test_statistics.py", line 131, in
test.test_statistics._DoNothing
Failed example:
approx_equal(12.345e6, 12.346e6, tol=1e-3, rel=1e-4)
Exception raised:
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/doctest.py", line 1324, in __run
compileflags, 1), test.globs)
File "<doctest test.test_statistics._DoNothing[4]>", line 1, in <module>
approx_equal(12.345e6, 12.346e6, tol=1e-3, rel=1e-4)
NameError: name 'approx_equal' is not defined
======================================================================
FAIL: _calc_errors (test.test_statistics)
Doctest: test.test_statistics._calc_errors
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/doctest.py", line 2193, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for test.test_statistics._calc_errors
File "/home/antoine/cpython/default/Lib/test/test_statistics.py", line 25, in
_calc_errors
----------------------------------------------------------------------
File "/home/antoine/cpython/default/Lib/test/test_statistics.py", line 28, in
test.test_statistics._calc_errors
Failed example:
_calc_errors(100, 75)
Exception raised:
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/doctest.py", line 1324, in __run
compileflags, 1), test.globs)
File "<doctest test.test_statistics._calc_errors[0]>", line 1, in <module>
_calc_errors(100, 75)
NameError: name '_calc_errors' is not defined
----------------------------------------------------------------------
File "/home/antoine/cpython/default/Lib/test/test_statistics.py", line 30, in
test.test_statistics._calc_errors
Failed example:
_calc_errors(100, 100)
Exception raised:
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/doctest.py", line 1324, in __run
compileflags, 1), test.globs)
File "<doctest test.test_statistics._calc_errors[1]>", line 1, in <module>
_calc_errors(100, 100)
NameError: name '_calc_errors' is not defined
======================================================================
FAIL: approx_equal (test.test_statistics)
Doctest: test.test_statistics.approx_equal
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/doctest.py", line 2193, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for test.test_statistics.approx_equal
File "/home/antoine/cpython/default/Lib/test/test_statistics.py", line 41, in
approx_equal
----------------------------------------------------------------------
File "/home/antoine/cpython/default/Lib/test/test_statistics.py", line 54, in
test.test_statistics.approx_equal
Failed example:
approx_equal(1.2589, 1.2587, tol=0.0003, rel=0)
Exception raised:
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/doctest.py", line 1324, in __run
compileflags, 1), test.globs)
File "<doctest test.test_statistics.approx_equal[0]>", line 1, in <module>
approx_equal(1.2589, 1.2587, tol=0.0003, rel=0)
NameError: name 'approx_equal' is not defined
----------------------------------------------------------------------
File "/home/antoine/cpython/default/Lib/test/test_statistics.py", line 56, in
test.test_statistics.approx_equal
Failed example:
approx_equal(1.2589, 1.2587, tol=0.0001, rel=0)
Exception raised:
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/doctest.py", line 1324, in __run
compileflags, 1), test.globs)
File "<doctest test.test_statistics.approx_equal[1]>", line 1, in <module>
approx_equal(1.2589, 1.2587, tol=0.0001, rel=0)
NameError: name 'approx_equal' is not defined
----------
assignee: stevenjd
components: Library (Lib), Tests
messages: 212008
nosy: pitrou, stevenjd
priority: high
severity: normal
status: open
title: test_statistics fails in refleak mode
type: behavior
versions: Python 3.4
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue20745>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com