Beispiel #1
0
def possible_test_module_names(module):
    module_name = module_path_to_name(module.subpath)

    for name in ["test_%s", "%s_test", "%sTest", "tests_%s", "%s_tests", "%sTests"]:
        yield (name % module_name) + ".py"
    for name in ["test%s", "Test%s", "%sTest", "tests%s", "Tests%s", "%sTests"]:
        yield (name % module_name.capitalize()) + ".py"
Beispiel #2
0
def possible_test_module_names(module):
    module_name = module_path_to_name(module.subpath)

    for name in ["test_%s", "%s_test", "%sTest", "tests_%s", "%s_tests", "%sTests"]:
        yield (name % module_name) + ".py"
    for name in ["test%s", "Test%s", "%sTest", "tests%s", "Tests%s", "%sTests"]:
        yield (name % module_name.capitalize()) + ".py"
Beispiel #3
0
def path2modname(path, default=""):
    """Take a path to a pythoscope module and return a module name in dot-style
    notation. Return default if path doesn't point to a pythoscope module.
    """
    match = re.search(r'.*pythoscope%s(.*)$' % re.escape(os.path.sep), path)
    if match:
        return module_path_to_name(match.group(1), newsep=".")
    else:
        return default
Beispiel #4
0
def path2modname(path, default=""):
    """Take a path to a pythoscope module and return a module name in dot-style
    notation. Return default if path doesn't point to a pythoscope module.
    """
    match = re.search(r'.*pythoscope%s(.*)$' % re.escape(os.path.sep), path)
    if match:
        return module_path_to_name(match.group(1), newsep=".")
    else:
        return default
Beispiel #5
0
def module_path_to_test_path(module):
    """Convert a module locator to a proper test filename.
    """
    return "test_%s.py" % module_path_to_name(module)
Beispiel #6
0
 def _get_locator(self):
     return module_path_to_name(self.subpath, newsep=".")
Beispiel #7
0
def module_path_to_test_path(module):
    """Convert a module locator to a proper test filename.
    """
    return "test_%s.py" % module_path_to_name(module)
Beispiel #8
0
 def _get_locator(self):
     return module_path_to_name(self.subpath, newsep=".")