Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: typ/tests/runner_test.py

Issue 2363773008: Add better logging when failing to load a test. (Closed)
Patch Set: patch for review Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« typ/tests/main_test.py ('K') | « typ/tests/main_test.py ('k') | 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 # Copyright 2014 Dirk Pranke. All rights reserved. 1 # Copyright 2014 Dirk Pranke. All rights reserved.
2 # 2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); 3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License. 4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at 5 # You may obtain a copy of the License at
6 # 6 #
7 # http://www.apache.org/licenses/LICENSE-2.0 7 # http://www.apache.org/licenses/LICENSE-2.0
8 # 8 #
9 # Unless required by applicable law or agreed to in writing, software 9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, 10 # distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 h.chdir(tmpdir) 91 h.chdir(tmpdir)
92 h.write_text_file('load_test.py', d("""\ 92 h.write_text_file('load_test.py', d("""\
93 import unittest 93 import unittest
94 def load_tests(_, _2, _3): 94 def load_tests(_, _2, _3):
95 assert False 95 assert False
96 """)) 96 """))
97 test_set = TestSet() 97 test_set = TestSet()
98 test_set.parallel_tests = [TestInput('load_test.BaseTest.test_x')] 98 test_set.parallel_tests = [TestInput('load_test.BaseTest.test_x')]
99 r = Runner() 99 r = Runner()
100 r.args.jobs = 1 100 r.args.jobs = 1
101 ret, _, _ = r.run(test_set) 101 ret, _, trace = r.run(test_set)
102 self.assertEqual(ret, 1) 102 self.assertEqual(ret, 1)
103 self.assertIn('Failed to load "load_test.BaseTest.test_x" in '
104 'run_one_test',
105 trace['traceEvents'][0]['args']['err'])
103 finally: 106 finally:
104 h.chdir(orig_wd) 107 h.chdir(orig_wd)
105 if tmpdir: 108 if tmpdir:
106 h.rmtree(tmpdir) 109 h.rmtree(tmpdir)
107 110
108 111
109 class TestWinMultiprocessing(TestCase): 112 class TestWinMultiprocessing(TestCase):
110 def make_host(self): 113 def make_host(self):
111 return Host() 114 return Host()
112 115
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 self.assertIn('No tests to run.', out) 215 self.assertIn('No tests to run.', out)
213 self.assertEqual(err, '') 216 self.assertEqual(err, '')
214 217
215 218
216 class ContextTests(TestCase): 219 class ContextTests(TestCase):
217 def test_context(self): 220 def test_context(self):
218 # This test is mostly intended to be called by 221 # This test is mostly intended to be called by
219 # RunnerTests.test_context, above. It is not interesting on its own. 222 # RunnerTests.test_context, above. It is not interesting on its own.
220 if self.context: 223 if self.context:
221 self.assertEquals(self.context['foo'], 'bar') 224 self.assertEquals(self.context['foo'], 'bar')
OLDNEW
« typ/tests/main_test.py ('K') | « typ/tests/main_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698