From a5f5e51f31860c3673a45d74f011fadfeeab1dc4 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 15 Jan 2017 09:49:39 -0500 Subject: Add a test of CheckUniqueFilenames --- tests/helpers.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'tests/helpers.py') diff --git a/tests/helpers.py b/tests/helpers.py index ebc15cd..a132872 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -54,11 +54,19 @@ class CheckUniqueFilenames(object): self.wrapped = wrapped @classmethod - def hook(cls, cov, method_name): - """Replace a method with our checking wrapper.""" - method = getattr(cov, method_name) + def hook(cls, obj, method_name): + """Replace a method with our checking wrapper. + + The method must take a string as a first argument. That argument + will be checked for uniqueness across all the calls to this method. + + The values don't have to be file names actually, just strings, but + we only use it for filename arguments. + + """ + method = getattr(obj, method_name) hook = cls(method) - setattr(cov, method_name, hook.wrapper) + setattr(obj, method_name, hook.wrapper) return hook def wrapper(self, filename, *args, **kwargs): -- cgit v1.2.1