'Test that pluginmanager correct marks pytest_plugins variables
for assertion rewriting if they are defined as plain strings or
list of strings (#1888).'

@pytest.mark.parametrize('mode', ['str', 'list'])
def test_pytest_plugins_rewrite_module_names(self, testdir, mode):

    plugins = ('"ham"' if (mode == 'str') else '["ham"]')
    contents = {'conftest.py': '\n                                                                pytest_plugins    =    {plugins}\n                                                '.format(plugins=plugins), 'ham.py': '\n                                                                import    pytest\n                                                ', 'test_foo.py': "\n                                                                def    test_foo(pytestconfig):\n                                                                                assert    'ham'    in    pytestconfig.pluginmanager.rewrite_hook._must_rewrite\n                                                "}
    testdir.makepyfile(**contents)
    result = testdir.runpytest_subprocess('--assert=rewrite')
    assert (result.ret == 0)
