________________________ test_doctest_float_replacement ________________________
tmpdir = local('/tmp/pytest-of-root/pytest-0/test_doctest_float_replacement0')
def test_doctest_float_replacement(tmpdir):
test1 = dedent("""
This will demonstrate a doctest that fails due to a few extra decimal
places::
>>> 1.0 / 3.0
0.333333333333333311
""")
test2 = dedent("""
This is the same test, but it should pass with use of
+FLOAT_CMP::
>>> 1.0 / 3.0 # doctest: +FLOAT_CMP
0.333333333333333311
""")
test1_rst = tmpdir.join('test1.rst')
test2_rst = tmpdir.join('test2.rst')
test1_rst.write(test1)
test2_rst.write(test2)
with pytest.raises(doctest.DocTestFailure):
doctest.testfile(str(test1_rst), module_relative=False,
raise_on_error=True, verbose=False, encoding='utf-8')
doctest.testfile(str(test2_rst), module_relative=False,
> raise_on_error=True, verbose=False, encoding='utf-8')
/venv/lib/python3.6/site-packages/astropy/tests/tests/test_run_tests.py:67:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.6/doctest.py:2074: in testfile
runner.run(test)
/usr/lib/python3.6/doctest.py:1839: in run
r = DocTestRunner.run(self, test, compileflags, out, False)
/usr/lib/python3.6/doctest.py:1476: in run
return self.__run(test, compileflags, out)
/usr/lib/python3.6/doctest.py:1377: in __run
self.report_failure(out, test, example, got)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <doctest.DebugRunner object at 0x7fb6771d6ac8>
out = <function DocTestRunner.run.<locals>.out at 0x7fb6974bef28>
test = <DocTest test2.rst from /tmp/pytest-of-root/pytest-0/test_doctest_float_replacement0/test2.rst:0 (1 example)>
example = <doctest.Example object at 0x7fb6811f5048>
got = '0.3333333333333333\n'
def report_failure(self, out, test, example, got):
> raise DocTestFailure(test, example, got)
E doctest.DocTestFailure: <DocTest test2.rst from /tmp/pytest-of-root/pytest-0/test_doctest_float_replacement0/test2.rst:0 (1 example)>
/usr/lib/python3.6/doctest.py:1848: DocTestFailure
I haven't investigated anything here, purely reporting what I see:
https://travis-ci.org/MacPython/astropy-wheels/jobs/613813972#L1331