1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Testing additions and fixes

* Fix import pathing for units.mock
* Add some additional requirements
* Use compileall to test compatiblity with different python versions
This commit is contained in:
Matt Martz 2015-05-08 11:34:19 -05:00
parent 0f1eb3cfc2
commit a0fc8bb0bd
9 changed files with 35 additions and 20 deletions

View file

@ -3,6 +3,12 @@ language: python
env:
- TOXENV=py26
- TOXENV=py27
addons:
apt:
sources:
- deadsnakes
packages:
- python2.4
install:
- pip install tox
script:

View file

@ -21,7 +21,7 @@ setup(name='ansible',
author_email='michael@ansible.com',
url='http://ansible.com/',
license='GPLv3',
install_requires=['paramiko', 'jinja2', "PyYAML", 'setuptools', 'pycrypto >= 2.6'],
install_requires=['paramiko', 'jinja2', "PyYAML", 'setuptools', 'pycrypto >= 2.6', 'six'],
package_dir={ '': 'lib' },
packages=find_packages('lib'),
package_data={

View file

@ -7,3 +7,4 @@ mock
passlib
coverage
coveralls
unittest2

View file

@ -26,7 +26,7 @@ from ansible.errors import AnsibleError, AnsibleParserError
from ansible.executor.play_iterator import PlayIterator
from ansible.playbook import Playbook
from test.mock.loader import DictDataLoader
from units.mock.loader import DictDataLoader
class TestPlayIterator(unittest.TestCase):

View file

@ -27,7 +27,7 @@ from ansible.playbook.play import Play
from ansible.playbook.role import Role
from ansible.playbook.task import Task
from test.mock.loader import DictDataLoader
from units.mock.loader import DictDataLoader
class TestPlay(unittest.TestCase):

View file

@ -26,7 +26,7 @@ from ansible.errors import AnsibleError, AnsibleParserError
from ansible.playbook import Playbook
from ansible.vars import VariableManager
from test.mock.loader import DictDataLoader
from units.mock.loader import DictDataLoader
class TestPlaybook(unittest.TestCase):

View file

@ -28,7 +28,7 @@ from ansible.playbook.role import Role
from ansible.playbook.role.include import RoleInclude
from ansible.playbook.task import Task
from test.mock.loader import DictDataLoader
from units.mock.loader import DictDataLoader
class TestRole(unittest.TestCase):

View file

@ -24,7 +24,7 @@ from ansible.compat.tests.mock import patch, MagicMock
from ansible.vars import VariableManager
from test.mock.loader import DictDataLoader
from units.mock.loader import DictDataLoader
class TestVariableManager(unittest.TestCase):

36
tox.ini
View file

@ -1,23 +1,31 @@
[tox]
envlist = {py26,py27}-v{1}
envlist = {py26,py27}
[testenv]
commands = make tests
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals = make
[testenv:py26-v1]
[testenv:py26]
commands =
python -m compileall -fq -x 'test|samples' .
python2.4 -m compileall -fq -x 'module_utils/(a10|rax|openstack|ec2|gce).py' lib/ansible/module_utils
make tests
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals =
make
python2.4
[testenv:py27-v1]
[testenv:py27]
commands =
python -m compileall -fq -x 'test|samples' .
make tests
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals = make
[testenv:py26-v2]
deps = -r{toxinidir}/v2/test-requirements.txt
commands = make newtests
[testenv:py27-v2]
deps = -r{toxinidir}/v2/test-requirements.txt
commands = make newtests
[testenv:py34-v2]
deps = -r{toxinidir}/v2/test-requirements.txt
commands = make newtests
[testenv:py34]
commands =
python -m compileall -fq -x 'lib/ansible/module_utils' lib
make tests
deps = -r-r{toxinidir}/test-requirements.txt
whitelist_externals = make