Skip to content

Commit

Permalink
Use monkeypatch.setenv instead of copying the os.environ for tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeecardona committed Apr 19, 2022
1 parent 1da807b commit 7a5942e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions guake/tests/test_about.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@


@pytest.fixture
def dialog(mocker):
def dialog(mocker, monkeypatch):
mocker.patch("guake.simplegladeapp.Gtk.Widget.show_all")
try:
old_os_environ = os.environ
os.environ["LANGUAGE"] = "en_US.UTF-8"
ad = AboutDialog()
yield ad
finally:
os.environ = old_os_environ
monkeypatch.setenv("LANGUAGE", "en_US.UTF-8")
yield AboutDialog()


def test_version_test(dialog):
Expand Down

0 comments on commit 7a5942e

Please sign in to comment.