From 9038b28ea4a9bc901cfac0fbfa2b5be87fb4dbee Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Tue, 25 Oct 2016 08:52:08 +0200 Subject: [PATCH] different mocking of open() in lineparser test apparently, python 3.4 (and less, probably) does not import builtins into modules --- tests/unit/misc/test_lineparser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/misc/test_lineparser.py b/tests/unit/misc/test_lineparser.py index a37a5fe27..adb5d1e82 100644 --- a/tests/unit/misc/test_lineparser.py +++ b/tests/unit/misc/test_lineparser.py @@ -65,7 +65,7 @@ class TestBaseLineParser: def test_double_open(self, mocker, lineparser): """Test if _open refuses reentry.""" - mocker.patch('qutebrowser.misc.lineparser.open', mock.mock_open()) + mocker.patch('builtins.open', mock.mock_open()) with lineparser._open('r'): with pytest.raises(IOError): @@ -75,7 +75,7 @@ class TestBaseLineParser: def test_binary(self, mocker): """Test if _open and _write correctly handle binary files.""" open_mock = mock.mock_open() - mocker.patch('qutebrowser.misc.lineparser.open', open_mock) + mocker.patch('builtins.open', open_mock) testdata = b'\xf0\xff'