@pytest.mark.parametrize('config_mode', ['ini', 'comment'])
def test_number_precision(self, testdir, config_mode):
    'Test the NUMBER option.'
    if (config_mode == 'ini'):
        testdir.makeini('\n                [pytest]\n                doctest_optionflags = NUMBER\n                ')
        comment = ''
    else:
        comment = '#doctest: +NUMBER'
    testdir.maketxtfile(test_doc="\n\n            Scalars:\n\n            >>> import math\n            >>> math.pi {comment}\n            3.141592653589793\n            >>> math.pi {comment}\n            3.1416\n            >>> math.pi {comment}\n            3.14\n            >>> -math.pi {comment}\n            -3.14\n            >>> math.pi {comment}\n            3.\n            >>> 3. {comment}\n            3.0\n            >>> 3. {comment}\n            3.\n            >>> 3. {comment}\n            3.01\n            >>> 3. {comment}\n            2.99\n            >>> .299 {comment}\n            .3\n            >>> .301 {comment}\n            .3\n            >>> 951. {comment}\n            1e3\n            >>> 1049. {comment}\n            1e3\n            >>> -1049. {comment}\n            -1e3\n            >>> 1e3 {comment}\n            1e3\n            >>> 1e3 {comment}\n            1000.\n\n            Lists:\n\n            >>> [3.1415, 0.097, 13.1, 7, 8.22222e5, 0.598e-2] {comment}\n            [3.14, 0.1, 13., 7, 8.22e5, 6.0e-3]\n            >>> [[0.333, 0.667], [0.999, 1.333]] {comment}\n            [[0.33, 0.667], [0.999, 1.333]]\n            >>> [[[0.101]]] {comment}\n            [[[0.1]]]\n\n            Doesn't barf on non-numbers:\n\n            >>> 'abc' {comment}\n            'abc'\n            >>> None {comment}\n            ".format(comment=comment))
    reprec = testdir.inline_run()
    reprec.assertoutcome(passed=1)
Test the NUMBER option.
@pytest.mark.parametrize('config_mode', ['ini', 'comment'])
def test_number_precision(self, testdir, config_mode):
    
    if (config_mode == 'ini'):
        testdir.makeini('\n                [pytest]\n                doctest_optionflags = NUMBER\n                ')
        comment = 
    else:
        comment = '#doctest: +NUMBER'
    testdir.maketxtfile(test_doc="\n\n            Scalars:\n\n            >>> import math\n            >>> math.pi {comment}\n            3.141592653589793\n            >>> math.pi {comment}\n            3.1416\n            >>> math.pi {comment}\n            3.14\n            >>> -math.pi {comment}\n            -3.14\n            >>> math.pi {comment}\n            3.\n            >>> 3. {comment}\n            3.0\n            >>> 3. {comment}\n            3.\n            >>> 3. {comment}\n            3.01\n            >>> 3. {comment}\n            2.99\n            >>> .299 {comment}\n            .3\n            >>> .301 {comment}\n            .3\n            >>> 951. {comment}\n            1e3\n            >>> 1049. {comment}\n            1e3\n            >>> -1049. {comment}\n            -1e3\n            >>> 1e3 {comment}\n            1e3\n            >>> 1e3 {comment}\n            1000.\n\n            Lists:\n\n            >>> [3.1415, 0.097, 13.1, 7, 8.22222e5, 0.598e-2] {comment}\n            [3.14, 0.1, 13., 7, 8.22e5, 6.0e-3]\n            >>> [[0.333, 0.667], [0.999, 1.333]] {comment}\n            [[0.33, 0.667], [0.999, 1.333]]\n            >>> [[[0.101]]] {comment}\n            [[[0.1]]]\n\n            Doesn't barf on non-numbers:\n\n            >>> 'abc' {comment}\n            'abc'\n            >>> None {comment}\n            ".format(comment=comment))
    reprec = testdir.inline_run()
    reprec.assertoutcome(passed=1)