Поддержка тестирования кода

This commit is contained in:
Andrei Astafev 2019-07-04 11:55:22 +03:00
parent 2469567d6a
commit 56f6527595
4 changed files with 25 additions and 0 deletions

View File

@ -13,3 +13,8 @@ html:
pdf:
make -C docs latexpdf
tests:
py.test-3 tests
.PHONY: clean zip html pdf tests

View File

@ -1,2 +1,3 @@
sphinx
pytest

0
tests/__init__.py Normal file
View File

19
tests/test_ap.py Normal file
View 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'])