fairseq/model_parallel/criterions/__init__.py

Killed 4 out of 8 mutants

Survived

Survived mutation testing. These mutants show holes in your test suite.

Mutant 2837

--- fairseq/model_parallel/criterions/__init__.py
+++ fairseq/model_parallel/criterions/__init__.py
@@ -9,7 +9,7 @@
 
 # automatically import any Python files in the criterions/ directory
 for file in os.listdir(os.path.dirname(__file__)):
-    if file.endswith('.py') and not file.startswith('_'):
+    if file.endswith('XX.pyXX') and not file.startswith('_'):
         module = file[:file.find('.py')]
         importlib.import_module('fairseq.model_parallel.criterions.' + module)
 

Mutant 2838

--- fairseq/model_parallel/criterions/__init__.py
+++ fairseq/model_parallel/criterions/__init__.py
@@ -9,7 +9,7 @@
 
 # automatically import any Python files in the criterions/ directory
 for file in os.listdir(os.path.dirname(__file__)):
-    if file.endswith('.py') and not file.startswith('_'):
+    if file.endswith('.py') and  file.startswith('_'):
         module = file[:file.find('.py')]
         importlib.import_module('fairseq.model_parallel.criterions.' + module)
 

Mutant 2839

--- fairseq/model_parallel/criterions/__init__.py
+++ fairseq/model_parallel/criterions/__init__.py
@@ -9,7 +9,7 @@
 
 # automatically import any Python files in the criterions/ directory
 for file in os.listdir(os.path.dirname(__file__)):
-    if file.endswith('.py') and not file.startswith('_'):
+    if file.endswith('.py') and not file.startswith('XX_XX'):
         module = file[:file.find('.py')]
         importlib.import_module('fairseq.model_parallel.criterions.' + module)
 

Mutant 2840

--- fairseq/model_parallel/criterions/__init__.py
+++ fairseq/model_parallel/criterions/__init__.py
@@ -9,7 +9,7 @@
 
 # automatically import any Python files in the criterions/ directory
 for file in os.listdir(os.path.dirname(__file__)):
-    if file.endswith('.py') and not file.startswith('_'):
+    if file.endswith('.py') or not file.startswith('_'):
         module = file[:file.find('.py')]
         importlib.import_module('fairseq.model_parallel.criterions.' + module)