mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[soc2009/model-validation] Merget to trunk at r12009
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@12014 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		
							
								
								
									
										29
									
								
								tests/regressiontests/test_runner/tests.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								tests/regressiontests/test_runner/tests.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| """ | ||||
| Tests for django test runner | ||||
| """ | ||||
| import StringIO | ||||
| import unittest | ||||
| import django | ||||
| from django.test import simple | ||||
|  | ||||
| class DjangoTestRunnerTests(unittest.TestCase): | ||||
|  | ||||
|     def test_failfast(self): | ||||
|         class MockTestOne(unittest.TestCase): | ||||
|             def runTest(self): | ||||
|                 assert False | ||||
|         class MockTestTwo(unittest.TestCase): | ||||
|             def runTest(self): | ||||
|                 assert False | ||||
|  | ||||
|         suite = unittest.TestSuite([MockTestOne(), MockTestTwo()]) | ||||
|         mock_stream = StringIO.StringIO() | ||||
|         dtr = simple.DjangoTestRunner(verbosity=0, failfast=False, stream=mock_stream) | ||||
|         result = dtr.run(suite) | ||||
|         self.assertEqual(2, result.testsRun) | ||||
|         self.assertEqual(2, len(result.failures)) | ||||
|  | ||||
|         dtr = simple.DjangoTestRunner(verbosity=0, failfast=True, stream=mock_stream) | ||||
|         result = dtr.run(suite) | ||||
|         self.assertEqual(1, result.testsRun) | ||||
|         self.assertEqual(1, len(result.failures)) | ||||
		Reference in New Issue
	
	Block a user