def open(self, filename: str, mode: str = "r", encoding: str | None = None) -> IO[str]:
        """Be just like `open`, but write written file names to `self.written`."""
        if mode.startswith("w"):
            self.written.add(filename.replace('\\', '/'))
        return open(filename, mode, encoding=encoding)
Be just like `open`, but write written file names to `self.written`.
tests/test_html.py