mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
tests: resolve deprecation warnings (#2028)
* tests: resolve deprecation warnings Fixes #2021 * tests: resolve deprecation warnings Fixes #2021
This commit is contained in:
committed by
Ruslan Kuprieiev
parent
037f32c8cc
commit
ee6a0b2875
@@ -428,10 +428,10 @@ class TestCheckoutShouldHaveSelfClearingProgressBar(TestDvc):
|
||||
finish_bar = progress_bars[-1]
|
||||
|
||||
self.assertEqual(4, len(update_bars))
|
||||
self.assertRegexpMatches(progress_bars[0], ".*\\[#{7} {23}\\] 25%.*")
|
||||
self.assertRegexpMatches(progress_bars[1], ".*\\[#{15} {15}\\] 50%.*")
|
||||
self.assertRegexpMatches(progress_bars[2], ".*\\[#{22} {8}\\] 75%.*")
|
||||
self.assertRegexpMatches(progress_bars[3], ".*\\[#{30}\\] 100%.*")
|
||||
assert re.search(".*\\[#{7} {23}\\] 25%.*", progress_bars[0])
|
||||
assert re.search(".*\\[#{15} {15}\\] 50%.*", progress_bars[1])
|
||||
assert re.search(".*\\[#{22} {8}\\] 75%.*", progress_bars[2])
|
||||
assert re.search(".*\\[#{30}\\] 100%.*", progress_bars[3])
|
||||
|
||||
self.assertCaretReturnFollowsEach(update_bars)
|
||||
self.assertNewLineFollows(finish_bar)
|
||||
|
||||
@@ -150,10 +150,10 @@ class TestColorFormatter:
|
||||
|
||||
assert expected == formatter.format(caplog.records[0])
|
||||
|
||||
def test_progress_awareness(self, mock, capsys, caplog):
|
||||
def test_progress_awareness(self, mocker, capsys, caplog):
|
||||
from dvc.progress import progress
|
||||
|
||||
with mock.patch("sys.stdout.isatty", return_value=True):
|
||||
with mocker.patch("sys.stdout.isatty", return_value=True):
|
||||
progress.set_n_total(100)
|
||||
progress.update_target("progress", 1, 10)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user