fairseq/file_io.py
Killed 0 out of 11 mutantsSurvived
Survived mutation testing. These mutants show holes in your test suite.Mutant 38
--- fairseq/file_io.py
+++ fairseq/file_io.py
@@ -14,7 +14,7 @@
from fvcore.common.file_io import PathManager as FVCorePathManager
except ImportError:
- FVCorePathManager = None
+ FVCorePathManager = ""
class PathManager:
Mutant 39
--- fairseq/file_io.py
+++ fairseq/file_io.py
@@ -24,7 +24,6 @@
internal backends).
"""
- @staticmethod
def open(
path: str,
mode: str = "r",
Mutant 40
--- fairseq/file_io.py
+++ fairseq/file_io.py
@@ -51,7 +51,6 @@
newline=newline,
)
- @staticmethod
def copy(src_path: str, dst_path: str, overwrite: bool = False) -> bool:
if FVCorePathManager:
return FVCorePathManager.copy(
Mutant 41
--- fairseq/file_io.py
+++ fairseq/file_io.py
@@ -52,7 +52,7 @@
)
@staticmethod
- def copy(src_path: str, dst_path: str, overwrite: bool = False) -> bool:
+ def copy(src_path: str, dst_path: str, overwrite: bool = True) -> bool:
if FVCorePathManager:
return FVCorePathManager.copy(
src_path=src_path, dst_path=dst_path, overwrite=overwrite
Mutant 42
--- fairseq/file_io.py
+++ fairseq/file_io.py
@@ -59,7 +59,6 @@
)
return shutil.copyfile(src_path, dst_path)
- @staticmethod
def get_local_path(path: str, **kwargs) -> str:
if FVCorePathManager:
return FVCorePathManager.get_local_path(path, **kwargs)
Mutant 43
--- fairseq/file_io.py
+++ fairseq/file_io.py
@@ -65,7 +65,6 @@
return FVCorePathManager.get_local_path(path, **kwargs)
return path
- @staticmethod
def exists(path: str) -> bool:
if FVCorePathManager:
return FVCorePathManager.exists(path)
Mutant 44
--- fairseq/file_io.py
+++ fairseq/file_io.py
@@ -71,7 +71,6 @@
return FVCorePathManager.exists(path)
return os.path.exists(path)
- @staticmethod
def isfile(path: str) -> bool:
if FVCorePathManager:
return FVCorePathManager.isfile(path)
Mutant 45
--- fairseq/file_io.py
+++ fairseq/file_io.py
@@ -77,7 +77,6 @@
return FVCorePathManager.isfile(path)
return os.path.isfile(path)
- @staticmethod
def ls(path: str) -> List[str]:
if FVCorePathManager:
return FVCorePathManager.ls(path)
Mutant 46
--- fairseq/file_io.py
+++ fairseq/file_io.py
@@ -83,7 +83,6 @@
return FVCorePathManager.ls(path)
return os.listdir(path)
- @staticmethod
def mkdirs(path: str) -> None:
if FVCorePathManager:
return FVCorePathManager.mkdirs(path)
Mutant 47
--- fairseq/file_io.py
+++ fairseq/file_io.py
@@ -89,7 +89,6 @@
return FVCorePathManager.mkdirs(path)
os.makedirs(path, exist_ok=True)
- @staticmethod
def rm(path: str) -> None:
if FVCorePathManager:
return FVCorePathManager.rm(path)
Mutant 48
--- fairseq/file_io.py
+++ fairseq/file_io.py
@@ -95,7 +95,6 @@
return FVCorePathManager.rm(path)
os.remove(path)
- @staticmethod
def register_handler(handler) -> None:
if FVCorePathManager:
return FVCorePathManager.register_handler(handler=handler)