some manual py2 cleanups

This commit is contained in:
Anthony Sottile 2020-01-08 21:23:18 -08:00
parent 30c1e8289f
commit ab19b94811
23 changed files with 31 additions and 59 deletions

View file

@ -1,6 +1,6 @@
import os
from unittest import mock
import mock
import pytest
from pre_commit.envcontext import envcontext
@ -91,11 +91,11 @@ def test_exception_safety():
class MyError(RuntimeError):
pass
env = {}
env = {'hello': 'world'}
with pytest.raises(MyError):
with envcontext([('foo', 'bar')], _env=env):
raise MyError()
assert env == {}
assert env == {'hello': 'world'}
def test_integration_os_environ():