#!/usr/bin/env python
# coding: utf-8

from unittest import TestLoader as BaseTestLoader, TestSuite

class TestLoader(BaseTestLoader):
  def __init__(self):
    BaseTestLoader.__init__(self)

  def loadTestsFromName(self, name, module=None):
    return self.loadTestsFromNames([name])

  def loadTestsFromNames(self, names, module=None):
    suite = TestSuite()
    for test in findTests(dirs=names):
      suite.addTests(super(TestLoader, self).loadTestsFromName(test))
    return suite

def findTests(dirs):
  import os, re
  pattern = re.compile('([a-z]+_)+test\.py$')
  for dir in dirs:
    for fileName in os.listdir(dir):
      if pattern.match(fileName):
        yield os.path.join(dir, fileName).replace('.py', '').replace(os.sep, '.')

__all__ = [TestLoader]


@@ -92,16 +92,27 @@
 estSuite
+%0Aimport sys
 %0A%0Aclass 
@@ -254,19 +254,160 @@
     
-return
+suite = TestSuite()%0A    for test in findTests(name):%0A      sys.path.insert(0, name) # python3 compatibility%0A      suite.addTests(super(TestLoader,
  self
+)
 .loa
@@ -424,17 +424,78 @@
 Name
-s(%5Bname%5D)
+(test))%0A      del sys.path%5B0%5D # python3 compatibility%0A    return suite
 %0A%0A  
@@ -580,37 +580,21 @@
 for 
-test in findTests(dirs=
+name in 
 names
-)
 :%0A  
@@ -612,39 +612,20 @@
 ddTests(
-super(TestLoader, 
 self
-)
 .loadTes
@@ -631,28 +631,28 @@
 stsFromName(
-test
+name
 ))%0A    retur
@@ -677,17 +677,16 @@
 ests(dir
-s
 ):%0A  imp
@@ -746,29 +746,8 @@
 $')%0A
-  for dir in dirs:%0A  
   fo
@@ -781,18 +781,16 @@
 r):%0A    
-  
 if patte
@@ -805,26 +805,24 @@
 (fileName):%0A
-  
       yield 

Make test loader python3 compatible.