eric7/Utilities/__init__.py

branch
eric7
changeset 9106
287d5afa2dbe
parent 9092
043848f65726
child 9133
3615ce93b738
diff -r d51cc25ea3a5 -r 287d5afa2dbe eric7/Utilities/__init__.py
--- a/eric7/Utilities/__init__.py	Mon May 30 09:43:54 2022 +0200
+++ b/eric7/Utilities/__init__.py	Mon May 30 09:51:57 2022 +0200
@@ -1309,7 +1309,8 @@
     Function to build the potential file names of a test file.
     
     The file names for the test file is built by prepending the string
-    "test" and "test_" to the file name passed into this function.
+    "test" and "test_" to the file name passed into this function and
+    by appending the string "_test".
     
     @param fn file name basis to be used for the test file names
     @type str
@@ -1317,9 +1318,15 @@
     @rtype list of str
     """
     dn, fn = os.path.split(fn)
+    fn, ext = os.psth.splitext(fn)
     prefixes = ["test", "test_"]
+    postfixes = ["_test"]
     return [
-        os.path.join(dn, "{0}{1}".format(prefix, fn)) for prefix in prefixes
+        os.path.join(dn, "{0}{1}{2}".format(prefix, fn, ext))
+        for prefix in prefixes
+    ] + [
+        os.path.join(dn, "{0}{1}{2}".format(fn, postfix, ext))
+        for postfix in postfixes
     ]
 
 

eric ide

mercurial