Some mypy & test tweaks

This commit is contained in:
Sybren A. Stüvel 2018-03-09 16:29:30 +01:00
parent 53a2ca4373
commit ef5c46eba5
3 changed files with 7 additions and 3 deletions

View File

@ -10,7 +10,7 @@ log = logging.getLogger(__name__)
class FileCopier(threading.Thread, transfer.FileTransferer): class FileCopier(threading.Thread, transfer.FileTransferer):
"""Copies or moves files in source directory order.""" """Copies or moves files in source directory order."""
def __init__(self): def __init__(self) -> None:
# Stupid Thread.__init__ doesn't call super().__init__(), # Stupid Thread.__init__ doesn't call super().__init__(),
# so it doesn't get chained to transfer.FileTransferer.__init__(). # so it doesn't get chained to transfer.FileTransferer.__init__().
# However, I want to have Thread as first subclass so that its # However, I want to have Thread as first subclass so that its
@ -18,7 +18,7 @@ class FileCopier(threading.Thread, transfer.FileTransferer):
threading.Thread.__init__(self) threading.Thread.__init__(self)
transfer.FileTransferer.__init__(self) transfer.FileTransferer.__init__(self)
def run(self): def run(self) -> None:
files_transferred = 0 files_transferred = 0
files_skipped = 0 files_skipped = 0
@ -52,7 +52,7 @@ class FileCopier(threading.Thread, transfer.FileTransferer):
# TODO(Sybren): when we target Py 3.6+, remove the str() calls. # TODO(Sybren): when we target Py 3.6+, remove the str() calls.
tfunc = transfer_funcs[act] tfunc = transfer_funcs[act]
tfunc(str(src), str(dst)) tfunc(str(src), str(dst)) # type: ignore
files_transferred += 1 files_transferred += 1
except Exception: except Exception:

View File

@ -9,3 +9,5 @@ max-line-length = 100
python_version = 3.5 python_version = 3.5
warn_redundant_casts = True warn_redundant_casts = True
ignore_missing_imports = True
incremental = True

View File

@ -35,6 +35,8 @@ class AbstractPackTest(AbstractBlendFileTest):
for path, action in packer._actions.items() for path, action in packer._actions.items()
if action.rewrites} if action.rewrites}
class PackTest(AbstractPackTest):
def test_strategise_no_rewrite_required(self): def test_strategise_no_rewrite_required(self):
infile = self.blendfiles / 'doubly_linked.blend' infile = self.blendfiles / 'doubly_linked.blend'