##// END OF EJS Templates
Merge pull request #4259 from takluyver/win-test-exclusions...
Thomas Kluyver -
r12765:1bf5b7e4 merge
parent child Browse files
Show More
@@ -374,7 +374,7 b' def onlyif_cmds_exist(*commands):'
374 "is installed".format(cmd))
374 "is installed".format(cmd))
375 except ImportError as e:
375 except ImportError as e:
376 # is_cmd_found uses pywin32 on windows, which might not be available
376 # is_cmd_found uses pywin32 on windows, which might not be available
377 if sys.platform == 'win32' and 'pywin32' in e.message:
377 if sys.platform == 'win32' and 'pywin32' in str(e):
378 return skip("This test runs only if pywin32 and command '{0}' "
378 return skip("This test runs only if pywin32 and command '{0}' "
379 "is installed".format(cmd))
379 "is installed".format(cmd))
380 raise e
380 raise e
@@ -324,14 +324,10 b' class ExclusionPlugin(Plugin):'
324 ----------
324 ----------
325
325
326 exclude_patterns : sequence of strings, optional
326 exclude_patterns : sequence of strings, optional
327 These patterns are compiled as regular expressions, subsequently used
327 Filenames containing these patterns (as raw strings, not as regular
328 to exclude any filename which matches them from inclusion in the test
328 expressions) are excluded from the tests.
329 suite (using pattern.search(), NOT pattern.match() ).
330 """
329 """
331
330 self.exclude_patterns = exclude_patterns or []
332 if exclude_patterns is None:
333 exclude_patterns = []
334 self.exclude_patterns = [re.compile(p) for p in exclude_patterns]
335 super(ExclusionPlugin, self).__init__()
331 super(ExclusionPlugin, self).__init__()
336
332
337 def options(self, parser, env=os.environ):
333 def options(self, parser, env=os.environ):
@@ -345,14 +341,14 b' class ExclusionPlugin(Plugin):'
345 def wantFile(self, filename):
341 def wantFile(self, filename):
346 """Return whether the given filename should be scanned for tests.
342 """Return whether the given filename should be scanned for tests.
347 """
343 """
348 if any(pat.search(filename) for pat in self.exclude_patterns):
344 if any(pat in filename for pat in self.exclude_patterns):
349 return False
345 return False
350 return None
346 return None
351
347
352 def wantDirectory(self, directory):
348 def wantDirectory(self, directory):
353 """Return whether the given directory should be scanned for tests.
349 """Return whether the given directory should be scanned for tests.
354 """
350 """
355 if any(pat.search(directory) for pat in self.exclude_patterns):
351 if any(pat in directory for pat in self.exclude_patterns):
356 return False
352 return False
357 return None
353 return None
358
354
General Comments 0
You need to be logged in to leave comments. Login now