Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: patchconv/tests/test_rietveld_to_git.py

Issue 29670655: Noissue - Remove bare exception from test case (Closed) Base URL: https://hg.adblockplus.org/codingtools/
Patch Set: Changed Exception to ImportError Created Jan. 25, 2018, 7 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # This file is part of Adblock Plus <https://adblockplus.org/>, 1 # This file is part of Adblock Plus <https://adblockplus.org/>,
2 # Copyright (C) 2006-present eyeo GmbH 2 # Copyright (C) 2006-present eyeo GmbH
3 # 3 #
4 # Adblock Plus is free software: you can redistribute it and/or modify 4 # Adblock Plus is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 3 as 5 # it under the terms of the GNU General Public License version 3 as
6 # published by the Free Software Foundation. 6 # published by the Free Software Foundation.
7 # 7 #
8 # Adblock Plus is distributed in the hope that it will be useful, 8 # Adblock Plus is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details. 11 # GNU General Public License for more details.
12 # 12 #
13 # You should have received a copy of the GNU General Public License 13 # You should have received a copy of the GNU General Public License
14 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 14 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
15 15
16 from __future__ import print_function, unicode_literals 16 from __future__ import print_function, unicode_literals
17 17
18 import os 18 import os
19 import subprocess 19 import subprocess
20 try: 20 try:
21 from StringIO import StringIO 21 from StringIO import StringIO
22 except: 22 except ImportError:
23 from io import StringIO 23 from io import StringIO
24 24
25 import mock 25 import mock
26 import pytest 26 import pytest
27 27
28 import patchconv 28 import patchconv
29 29
30 TEST_DIR = os.path.dirname(__file__) 30 TEST_DIR = os.path.dirname(__file__)
31 31
32 32
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 --- a/README.txt 75 --- a/README.txt
76 ''' 76 '''
77 out, err = process.communicate(input=in_patch.encode('ascii')) 77 out, err = process.communicate(input=in_patch.encode('ascii'))
78 assert out == expect.encode('ascii') 78 assert out == expect.encode('ascii')
79 79
80 stdin = StringIO(in_patch) 80 stdin = StringIO(in_patch)
81 stdout = StringIO() 81 stdout = StringIO()
82 with mock.patch('sys.stdin', stdin), mock.patch('sys.stdout', stdout): 82 with mock.patch('sys.stdin', stdin), mock.patch('sys.stdout', stdout):
83 patchconv.main() 83 patchconv.main()
84 assert stdout.getvalue() == expect 84 assert stdout.getvalue() == expect
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld