Show More
@@ -324,14 +324,10 b' class ExclusionPlugin(Plugin):' | |||
|
324 | 324 | ---------- |
|
325 | 325 | |
|
326 | 326 | exclude_patterns : sequence of strings, optional |
|
327 | These patterns are compiled as regular expressions, subsequently used | |
|
328 | to exclude any filename which matches them from inclusion in the test | |
|
329 | suite (using pattern.search(), NOT pattern.match() ). | |
|
327 | Filenames containing these patterns (as raw strings, not as regular | |
|
328 | expressions) are excluded from the tests. | |
|
330 | 329 | """ |
|
331 | ||
|
332 | if exclude_patterns is None: | |
|
333 | exclude_patterns = [] | |
|
334 | self.exclude_patterns = [re.compile(p) for p in exclude_patterns] | |
|
330 | self.exclude_patterns = exclude_patterns or [] | |
|
335 | 331 | super(ExclusionPlugin, self).__init__() |
|
336 | 332 | |
|
337 | 333 | def options(self, parser, env=os.environ): |
@@ -345,14 +341,14 b' class ExclusionPlugin(Plugin):' | |||
|
345 | 341 | def wantFile(self, filename): |
|
346 | 342 | """Return whether the given filename should be scanned for tests. |
|
347 | 343 | """ |
|
348 |
if any(pat |
|
|
344 | if any(pat in filename for pat in self.exclude_patterns): | |
|
349 | 345 | return False |
|
350 | 346 | return None |
|
351 | 347 | |
|
352 | 348 | def wantDirectory(self, directory): |
|
353 | 349 | """Return whether the given directory should be scanned for tests. |
|
354 | 350 | """ |
|
355 |
if any(pat |
|
|
351 | if any(pat in directory for pat in self.exclude_patterns): | |
|
356 | 352 | return False |
|
357 | 353 | return None |
|
358 | 354 |
General Comments 0
You need to be logged in to leave comments.
Login now