Skip to content

Commit 0e6f469

Browse files
Try to use mock.any for env in test_status.py. Update timeout value to 20.0.
1 parent c29b4df commit 0e6f469

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

jupyterlab_git/tests/test_status.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
from unittest.mock import call, patch
1+
from unittest.mock import call, patch, ANY
22

33
import pytest
44

5-
import os
6-
75
# local lib
86
from jupyterlab_git.git import Git
97

@@ -376,8 +374,8 @@ async def test_status(tmp_path, output, diff_output, expected):
376374
call(
377375
["git", "status", "--porcelain", "-b", "-u", "-z"],
378376
cwd=str(repository),
379-
timeout=20,
380-
env=os.environ.copy(),
377+
timeout=20.0,
378+
env=ANY,
381379
username=None,
382380
password=None,
383381
is_binary=False,
@@ -392,44 +390,44 @@ async def test_status(tmp_path, output, diff_output, expected):
392390
"4b825dc642cb6eb9a060e54bf8d69288fbee4904",
393391
],
394392
cwd=str(repository),
395-
timeout=20,
396-
env=os.environ.copy(),
393+
timeout=20.0,
394+
env=ANY,
397395
username=None,
398396
password=None,
399397
is_binary=False,
400398
),
401399
call(
402400
["git", "show", "--quiet", "CHERRY_PICK_HEAD"],
403401
cwd=str(repository),
404-
timeout=20,
405-
env=os.environ.copy(),
402+
timeout=20.0,
403+
env=ANY,
406404
username=None,
407405
password=None,
408406
is_binary=False,
409407
),
410408
call(
411409
["git", "show", "--quiet", "MERGE_HEAD"],
412410
cwd=str(repository),
413-
timeout=20,
414-
env=os.environ.copy(),
411+
timeout=20.0,
412+
env=ANY,
415413
username=None,
416414
password=None,
417415
is_binary=False,
418416
),
419417
call(
420418
["git", "rev-parse", "--git-path", "rebase-merge"],
421419
cwd=str(repository),
422-
timeout=20,
423-
env=os.environ.copy(),
420+
timeout=20.0,
421+
env=ANY,
424422
username=None,
425423
password=None,
426424
is_binary=False,
427425
),
428426
call(
429427
["git", "rev-parse", "--git-path", "rebase-apply"],
430428
cwd=str(repository),
431-
timeout=20,
432-
env=os.environ.copy(),
429+
timeout=20.0,
430+
env=ANY,
433431
username=None,
434432
password=None,
435433
is_binary=False,

0 commit comments

Comments
 (0)