fairseq/model_parallel/models/__init__.py

Killed 7 out of 15 mutants

Survived

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

Mutant 2573

--- fairseq/model_parallel/models/__init__.py
+++ fairseq/model_parallel/models/__init__.py
@@ -11,7 +11,7 @@
 models_dir = os.path.dirname(__file__)
 for file in os.listdir(models_dir):
     path = os.path.join(models_dir, file)
-    if not file.startswith('_') and not file.startswith('.') and (file.endswith('.py') or os.path.isdir(path)):
+    if  file.startswith('_') and not file.startswith('.') and (file.endswith('.py') or os.path.isdir(path)):
         model_name = file[:file.find('.py')] if file.endswith('.py') else file
         module = importlib.import_module('fairseq.model_parallel.models.' + model_name)
 

Mutant 2574

--- fairseq/model_parallel/models/__init__.py
+++ fairseq/model_parallel/models/__init__.py
@@ -11,7 +11,7 @@
 models_dir = os.path.dirname(__file__)
 for file in os.listdir(models_dir):
     path = os.path.join(models_dir, file)
-    if not file.startswith('_') and not file.startswith('.') and (file.endswith('.py') or os.path.isdir(path)):
+    if not file.startswith('XX_XX') and not file.startswith('.') and (file.endswith('.py') or os.path.isdir(path)):
         model_name = file[:file.find('.py')] if file.endswith('.py') else file
         module = importlib.import_module('fairseq.model_parallel.models.' + model_name)
 

Mutant 2575

--- fairseq/model_parallel/models/__init__.py
+++ fairseq/model_parallel/models/__init__.py
@@ -11,7 +11,7 @@
 models_dir = os.path.dirname(__file__)
 for file in os.listdir(models_dir):
     path = os.path.join(models_dir, file)
-    if not file.startswith('_') and not file.startswith('.') and (file.endswith('.py') or os.path.isdir(path)):
+    if not file.startswith('_') and  file.startswith('.') and (file.endswith('.py') or os.path.isdir(path)):
         model_name = file[:file.find('.py')] if file.endswith('.py') else file
         module = importlib.import_module('fairseq.model_parallel.models.' + model_name)
 

Mutant 2576

--- fairseq/model_parallel/models/__init__.py
+++ fairseq/model_parallel/models/__init__.py
@@ -11,7 +11,7 @@
 models_dir = os.path.dirname(__file__)
 for file in os.listdir(models_dir):
     path = os.path.join(models_dir, file)
-    if not file.startswith('_') and not file.startswith('.') and (file.endswith('.py') or os.path.isdir(path)):
+    if not file.startswith('_') and not file.startswith('XX.XX') and (file.endswith('.py') or os.path.isdir(path)):
         model_name = file[:file.find('.py')] if file.endswith('.py') else file
         module = importlib.import_module('fairseq.model_parallel.models.' + model_name)
 

Mutant 2577

--- fairseq/model_parallel/models/__init__.py
+++ fairseq/model_parallel/models/__init__.py
@@ -11,7 +11,7 @@
 models_dir = os.path.dirname(__file__)
 for file in os.listdir(models_dir):
     path = os.path.join(models_dir, file)
-    if not file.startswith('_') and not file.startswith('.') and (file.endswith('.py') or os.path.isdir(path)):
+    if not file.startswith('_') and not file.startswith('.') and (file.endswith('XX.pyXX') or os.path.isdir(path)):
         model_name = file[:file.find('.py')] if file.endswith('.py') else file
         module = importlib.import_module('fairseq.model_parallel.models.' + model_name)
 

Mutant 2578

--- fairseq/model_parallel/models/__init__.py
+++ fairseq/model_parallel/models/__init__.py
@@ -11,7 +11,7 @@
 models_dir = os.path.dirname(__file__)
 for file in os.listdir(models_dir):
     path = os.path.join(models_dir, file)
-    if not file.startswith('_') and not file.startswith('.') and (file.endswith('.py') or os.path.isdir(path)):
+    if not file.startswith('_') and not file.startswith('.') and (file.endswith('.py') and os.path.isdir(path)):
         model_name = file[:file.find('.py')] if file.endswith('.py') else file
         module = importlib.import_module('fairseq.model_parallel.models.' + model_name)
 

Mutant 2579

--- fairseq/model_parallel/models/__init__.py
+++ fairseq/model_parallel/models/__init__.py
@@ -11,7 +11,7 @@
 models_dir = os.path.dirname(__file__)
 for file in os.listdir(models_dir):
     path = os.path.join(models_dir, file)
-    if not file.startswith('_') and not file.startswith('.') and (file.endswith('.py') or os.path.isdir(path)):
+    if not file.startswith('_') or not file.startswith('.') and (file.endswith('.py') or os.path.isdir(path)):
         model_name = file[:file.find('.py')] if file.endswith('.py') else file
         module = importlib.import_module('fairseq.model_parallel.models.' + model_name)
 

Mutant 2585

--- fairseq/model_parallel/models/__init__.py
+++ fairseq/model_parallel/models/__init__.py
@@ -13,5 +13,5 @@
     path = os.path.join(models_dir, file)
     if not file.startswith('_') and not file.startswith('.') and (file.endswith('.py') or os.path.isdir(path)):
         model_name = file[:file.find('.py')] if file.endswith('.py') else file
-        module = importlib.import_module('fairseq.model_parallel.models.' + model_name)
+        module = None