summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames <james@conan.io>2021-09-24 09:41:07 +0200
committerGitHub <noreply@github.com>2021-09-24 09:41:07 +0200
commitbf716c094d6b3f5acd727eed3c4b4fe1ad9e1c00 (patch)
tree8768ffae1627278aab879e158e5916cf545e0415
parent906a0563451f58211fae0441f80d7e5b464465aa (diff)
fixing conan.tools.files.patch (#9653)
-rw-r--r--conan/tools/files/patches.py2
-rw-r--r--conans/test/functional/tools/test_files.py3
2 files changed, 2 insertions, 3 deletions
diff --git a/conan/tools/files/patches.py b/conan/tools/files/patches.py
index dfc6b356..65561335 100644
--- a/conan/tools/files/patches.py
+++ b/conan/tools/files/patches.py
@@ -58,7 +58,7 @@ def patch(conanfile, base_path=None, patch_file=None, patch_string=None, strip=0
raise ConanException("Failed to parse patch: %s" % (patch_file if patch_file else "string"))
root = os.path.join(conanfile.source_folder, base_path) if base_path else conanfile.source_folder
- if not patchset.apply(root, strip=strip, fuzz=fuzz):
+ if not patchset.apply(strip=strip, root=root, fuzz=fuzz):
raise ConanException("Failed to apply patch: %s" % patch_file)
diff --git a/conans/test/functional/tools/test_files.py b/conans/test/functional/tools/test_files.py
index 563c9814..9abce407 100644
--- a/conans/test/functional/tools/test_files.py
+++ b/conans/test/functional/tools/test_files.py
@@ -14,7 +14,7 @@ from conans.util.files import save
class MockPatchset:
apply_args = None
- def apply(self, root, strip, fuzz):
+ def apply(self, strip=0, root=None, fuzz=False):
self.apply_args = (root, strip, fuzz)
return True
@@ -143,7 +143,6 @@ def test_apply_conandata_patches(mock_patch_ng):
'conandata.yml': conandata_yml})
client.run('create .')
-
assert mock_patch_ng.apply_args[0].endswith('source_subfolder')
assert mock_patch_ng.apply_args[1:] == (0, False)