mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
tests: use mocker instead of unittest.mock where possible
Had the "pleasure" of finding a mocker.patch leak into other tests and one of the suspicions is that mixing unittest.mock and mocker might be somehow related. In any case, we should use mocker where possible anyway.
This commit is contained in:
@@ -4,7 +4,6 @@ import os
|
||||
import shutil
|
||||
import stat
|
||||
import textwrap
|
||||
from unittest.mock import call
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -631,8 +630,8 @@ def test_add_optimization_for_hardlink_on_empty_files(tmp_dir, dvc, mocker):
|
||||
stages = dvc.add(["foo", "bar", "lorem", "ipsum"])
|
||||
|
||||
assert m.call_count == 8
|
||||
assert m.call_args != call(tmp_dir / "foo")
|
||||
assert m.call_args != call(tmp_dir / "bar")
|
||||
assert m.call_args != mocker.call(tmp_dir / "foo")
|
||||
assert m.call_args != mocker.call(tmp_dir / "bar")
|
||||
|
||||
for stage in stages[:2]:
|
||||
# hardlinks are not created for empty files
|
||||
|
||||
Reference in New Issue
Block a user