Поддержка тестирования кода
This commit is contained in:
		
							
								
								
									
										5
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								Makefile
									
									
									
									
									
								
							| @@ -13,3 +13,8 @@ html: | |||||||
| pdf: | pdf: | ||||||
| 	make -C docs latexpdf | 	make -C docs latexpdf | ||||||
|  |  | ||||||
|  | tests: | ||||||
|  | 	py.test-3 tests | ||||||
|  |  | ||||||
|  | .PHONY: clean zip html pdf tests | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,2 +1,3 @@ | |||||||
| sphinx | sphinx | ||||||
|  | pytest | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										0
									
								
								tests/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								tests/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										19
									
								
								tests/test_ap.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								tests/test_ap.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | |||||||
|  | import os | ||||||
|  | import sys | ||||||
|  | sys.path.insert(0, os.path.abspath('..')) | ||||||
|  |  | ||||||
|  | import pytest | ||||||
|  | from py3x.functions import parse_args | ||||||
|  |  | ||||||
|  | def test_parse_args_verbose(): | ||||||
|  |     args = parse_args(['-v']) | ||||||
|  |     assert args | ||||||
|  |  | ||||||
|  | def test_parse_args_input(): | ||||||
|  |     args = parse_args(['-i', 'input']) | ||||||
|  |     assert args | ||||||
|  |  | ||||||
|  | def test_parse_args_unused(): | ||||||
|  |     with pytest.raises(SystemExit): | ||||||
|  |         args = parse_args(['-b']) | ||||||
|  |  | ||||||
		Reference in New Issue
	
	Block a user