'Test that doctests which output unicode work in all python versions
tested by pytest when the ALLOW_UNICODE option is used (either in
the ini file or by an inline comment).'

@pytest.mark.parametrize('config_mode', ['ini', 'comment'])
def test_allow_unicode(self, testdir, config_mode):

    if (config_mode == 'ini'):
        testdir.makeini('\n                                                [pytest]\n                                                doctest_optionflags    =    ALLOW_UNICODE\n                                                ')
        comment = ''
    else:
        comment = '#doctest:    +ALLOW_UNICODE'
    testdir.maketxtfile(test_doc="\n                                                >>>    b'12'.decode('ascii')    {comment}\n                                                '12'\n                                ".format(comment=comment))
    testdir.makepyfile(foo="\n                                                def    foo():\n                                                        '''\n                                                        >>>    b'12'.decode('ascii')    {comment}\n                                                        '12'\n                                                        '''\n                                ".format(comment=comment))
    reprec = testdir.inline_run('--doctest-modules')
    reprec.assertoutcome(passed=2)
