'AssertionRewriteHook should remember rewritten modules so it
doesn\'t give false positives (#2005).'

def test_remember_rewritten_modules(self, pytestconfig, testdir, monkeypatch):

    monkeypatch.syspath_prepend(testdir.tmpdir)
    testdir.makepyfile(test_remember_rewritten_modules='')
    warnings = []
    hook = AssertionRewritingHook(pytestconfig)
    monkeypatch.setattr(hook.config, 'warn', (lambda code, msg: warnings.append(msg)))
    hook.find_module('test_remember_rewritten_modules')
    hook.load_module('test_remember_rewritten_modules')
    hook.mark_rewrite('test_remember_rewritten_modules')
    hook.mark_rewrite('test_remember_rewritten_modules')
    assert (warnings == [])
