File tree 2 files changed +43
-35
lines changed
2 files changed +43
-35
lines changed Original file line number Diff line number Diff line change @@ -423,23 +423,27 @@ def test_with_src_module_dir() -> None:
423
423
424
424
425
425
def test_default_with_excluded_data (mocker : MockerFixture ) -> None :
426
- # Patch git module to return specific excluded files
427
- p = mocker .patch ("poetry.core.vcs.git.Git.get_ignored_files" )
428
- p .return_value = [
429
- (
430
- (
431
- Path (__file__ ).parent
432
- / "fixtures"
433
- / "default_with_excluded_data"
434
- / "my_package"
435
- / "data"
436
- / "sub_data"
437
- / "data2.txt"
438
- )
439
- .relative_to (project ("default_with_excluded_data" ))
440
- .as_posix ()
441
- )
442
- ]
426
+ class MockGit :
427
+ def get_ignored_files (self , folder : Path | None = None ) -> list [str ]:
428
+ # Patch git module to return specific excluded files
429
+ return [
430
+ (
431
+ (
432
+ Path (__file__ ).parent
433
+ / "fixtures"
434
+ / "default_with_excluded_data"
435
+ / "my_package"
436
+ / "data"
437
+ / "sub_data"
438
+ / "data2.txt"
439
+ )
440
+ .relative_to (project ("default_with_excluded_data" ))
441
+ .as_posix ()
442
+ )
443
+ ]
444
+
445
+ p = mocker .patch ("poetry.core.vcs.get_vcs" )
446
+ p .return_value = MockGit ()
443
447
poetry = Factory ().create_poetry (project ("default_with_excluded_data" ))
444
448
445
449
builder = SdistBuilder (poetry )
Original file line number Diff line number Diff line change @@ -284,24 +284,28 @@ def test_wheel_with_file_with_comma() -> None:
284
284
285
285
286
286
def test_default_src_with_excluded_data (mocker : MockerFixture ) -> None :
287
- # Patch git module to return specific excluded files
288
- p = mocker .patch ("poetry.core.vcs.git.Git.get_ignored_files" )
289
- p .return_value = [
290
- (
291
- (
292
- Path (__file__ ).parent
293
- / "fixtures"
294
- / "default_src_with_excluded_data"
295
- / "src"
296
- / "my_package"
297
- / "data"
298
- / "sub_data"
299
- / "data2.txt"
300
- )
301
- .relative_to (project ("default_src_with_excluded_data" ))
302
- .as_posix ()
303
- )
304
- ]
287
+ class MockGit :
288
+ def get_ignored_files (self , folder : Path | None = None ) -> list [str ]:
289
+ # Patch git module to return specific excluded files
290
+ return [
291
+ (
292
+ (
293
+ Path (__file__ ).parent
294
+ / "fixtures"
295
+ / "default_src_with_excluded_data"
296
+ / "src"
297
+ / "my_package"
298
+ / "data"
299
+ / "sub_data"
300
+ / "data2.txt"
301
+ )
302
+ .relative_to (project ("default_src_with_excluded_data" ))
303
+ .as_posix ()
304
+ )
305
+ ]
306
+
307
+ p = mocker .patch ("poetry.core.vcs.get_vcs" )
308
+ p .return_value = MockGit ()
305
309
poetry = Factory ().create_poetry (project ("default_src_with_excluded_data" ))
306
310
307
311
builder = WheelBuilder (poetry )
You can’t perform that action at this time.
0 commit comments