'Test support for doctest_encoding ini option.'

@pytest.mark.parametrize('            test_string,                encoding', [(u'foo', 'ascii'), (u'\xf6\xe4\xfc', 'latin1'), (u'\xf6\xe4\xfc', 'utf-8')])
def test_encoding(self, testdir, test_string, encoding):

    testdir.makeini('\n                                                [pytest]\n                                                doctest_encoding={0}\n                                '.format(encoding))
    doctest = u'\n                                                >>>    u"{0}"\n                                                {1}\n                                '.format(test_string, repr(test_string))
    testdir._makefile('.txt', [doctest], {}, encoding=encoding)
    result = testdir.runpytest()
    result.stdout.fnmatch_lines(['*1    passed*'])
