mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-11 07:18:28 +01:00
Use monkeypatch in test_dagascii.py
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import mock
|
||||
import os
|
||||
|
||||
from dvc import dagascii
|
||||
@@ -21,8 +20,9 @@ def test_plainpager_returned_when_less_missing(mocker):
|
||||
assert pager.__name__ == "plainpager"
|
||||
|
||||
|
||||
def test_tempfilepager_returned_when_var_defined(mocker):
|
||||
mocker.patch.dict(os.environ, {"DVC_PAGER": dagascii.DEFAULT_PAGER})
|
||||
def test_tempfilepager_returned_when_var_defined(monkeypatch):
|
||||
monkeypatch.setenv(DVC_PAGER, dagascii.DEFAULT_PAGER)
|
||||
|
||||
pager = dagascii.find_pager()
|
||||
|
||||
assert pager.cmd == dagascii.DEFAULT_PAGER
|
||||
|
||||
Reference in New Issue
Block a user