Travis CI script for testing
This commit is contained in:
		
							parent
							
								
									662d0fede9
								
							
						
					
					
						commit
						ed1ba9e071
					
				|  | @ -0,0 +1,13 @@ | ||||||
|  | # Copyright 2012 Google Inc. All Rights Reserved. | ||||||
|  | 
 | ||||||
|  | # Travis CI script | ||||||
|  | # http://travis-ci.org/#!/benvanik/anvil-build | ||||||
|  | 
 | ||||||
|  | language: python | ||||||
|  | python: | ||||||
|  |   - 2.6 | ||||||
|  |   - 2.7 | ||||||
|  | 
 | ||||||
|  | install: python setup.py -q install | ||||||
|  | 
 | ||||||
|  | script: python setup.py test | ||||||
|  | @ -19,18 +19,24 @@ import util | ||||||
| def main(): | def main(): | ||||||
|   """Entry point for running tests. |   """Entry point for running tests. | ||||||
|   """ |   """ | ||||||
| 
 |   # Collect tests | ||||||
|   # Only find test_*.py files under anvil/ |   tests = collector() | ||||||
|   loader = unittest2.TestLoader() |  | ||||||
|   tests = loader.discover('anvil', |  | ||||||
|                           pattern='*_test.py', |  | ||||||
|                           top_level_dir='.') |  | ||||||
| 
 | 
 | ||||||
|   # Run the tests in the default runner |   # Run the tests in the default runner | ||||||
|   test_runner = unittest2.runner.TextTestRunner(verbosity=2) |   test_runner = unittest2.runner.TextTestRunner(verbosity=2) | ||||||
|   test_runner.run(tests) |   test_runner.run(tests) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | def collector(): | ||||||
|  |   """Collects test for the setuptools test_suite command. | ||||||
|  |   """ | ||||||
|  |   # Only find test_*.py files under anvil/ | ||||||
|  |   loader = unittest2.TestLoader() | ||||||
|  |   return loader.discover('anvil', | ||||||
|  |                          pattern='*_test.py', | ||||||
|  |                          top_level_dir='.') | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| class AsyncTestCase(unittest2.TestCase): | class AsyncTestCase(unittest2.TestCase): | ||||||
|   """Test case adding additional asserts for async results.""" |   """Test case adding additional asserts for async results.""" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								setup.py
								
								
								
								
							
							
						
						
									
										2
									
								
								setup.py
								
								
								
								
							|  | @ -44,7 +44,7 @@ setup( | ||||||
|         'unittest2>=0.5.1', |         'unittest2>=0.5.1', | ||||||
|         ], |         ], | ||||||
|     packages=['anvil',], |     packages=['anvil',], | ||||||
|     test_suite='anvil.test', |     test_suite='anvil.test.collector', | ||||||
|     include_package_data=True, |     include_package_data=True, | ||||||
|     zip_safe=True, |     zip_safe=True, | ||||||
|     entry_points = { |     entry_points = { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue