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

Unified Diff: third_party/typ/typ/tests/main_test.py

Issue 2417433002: Roll //third_party/typ to v0.9.8. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/typ/typ/runner.py ('k') | third_party/typ/typ/tests/runner_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/typ/typ/tests/main_test.py
diff --git a/third_party/typ/typ/tests/main_test.py b/third_party/typ/typ/tests/main_test.py
index 02993755ea62c52e45b972eb25586fde69fbe65b..771e98734ae0b96e4a15252fb432a24b4d8437de 100644
--- a/third_party/typ/typ/tests/main_test.py
+++ b/third_party/typ/typ/tests/main_test.py
@@ -18,7 +18,6 @@ import os
import sys
import textwrap
-
from typ import main
from typ import test_case
from typ import Host
@@ -142,15 +141,19 @@ SF_TEST_FILES = {'sf_test.py': SF_TEST_PY}
LOAD_TEST_PY = """
import unittest
+
class BaseTest(unittest.TestCase):
pass
+
def method_fail(self):
self.fail()
+
def method_pass(self):
pass
+
def load_tests(_, _2, _3):
setattr(BaseTest, "test_fail", method_fail)
setattr(BaseTest, "test_pass", method_pass)
@@ -355,8 +358,9 @@ class TestCli(test_case.MainTestCase):
self.check(['--help'], ret=0, rout='.*', err='')
def test_import_failure_missing_file(self):
- self.check(['-l', 'foo'], ret=1, err='',
- rout='Failed to load "foo".*')
+ _, out, _, _ = self.check(['-l', 'foo'], ret=1, err='')
+ self.assertIn('Failed to load "foo" in find_tests', out)
+ self.assertIn('No module named foo', out)
def test_import_failure_missing_package(self):
files = {'foo.py': d("""\
@@ -367,13 +371,14 @@ class TestCli(test_case.MainTestCase):
def test_case(self):
pass
""")}
- self.check(['-l', 'foo.py'], files=files, ret=1, err='',
- rout=('Failed to load "foo.py":'))
+ _, out, _, _ = self.check(['-l', 'foo.py'], files=files, ret=1, err='')
+ self.assertIn('Failed to load "foo.py" in find_tests', out)
+ self.assertIn('No module named package_that_does_not_exist', out)
def test_import_failure_no_tests(self):
files = {'foo.py': 'import unittest'}
- self.check(['-l', 'foo.bar'], files=files, ret=1, err='',
- rout='Failed to load "foo.bar":.*')
+ self.check(['-l', 'foo'], files=files, ret=1, err='',
+ out='No tests to run.\n')
def test_import_failure_syntax_error(self):
files = {'syn_test.py': d("""\
« no previous file with comments | « third_party/typ/typ/runner.py ('k') | third_party/typ/typ/tests/runner_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698