def wrapper(self, filename: str, *args: Any, **kwargs: Any) -> Any:
        """The replacement method.  Check that we don't have dupes."""
        assert filename not in self.filenames, (
            f"File name {filename!r} passed to {self.wrapped!r} twice"
        )
        self.filenames.add(filename)
        return self.wrapped(filename, *args, **kwargs)
The replacement method.  Check that we don't have dupes.
tests/helpers.py