Commit Graph

38 Commits (63c22f6eb0630858b02b1c4eb7982bdd42b7d493)

Author SHA1 Message Date
Bojan Vitnik a69e9e3470 Updated test constraints for mock assert_called() and assert_called_once() 6 years ago
Matt Clay 379a7f4f5a
Fix ansible-test unit test execution. (#45772)
* Fix ansible-test units requirements install.
* Run unit tests as unprivileged user under Docker.
6 years ago
Matt Clay 7abdab6c9e Convert ansible-test compile into a sanity test. 7 years ago
Ryan S. Brown ae5c370737 Fail hard when tests pass that are expected to fail
`@pytest.mark.xfail()` can be used to decorate tests that don't yet
pass. By default, if I wrote a test like this:

```
@pytest.mark.xfail()
def test_naughty():
    assert 1 == 1
```

Then Pytest would allow this test to pass without notifying that an
expected-fail *didn't* fail. To make that happen, you have to set
xfail_strict=True so that the above test would cause the tests to fail.
7 years ago
Matt Clay 7ab4a889ad Update tox.ini to use ansible-test. 8 years ago
Adrian Likins a936ea1333 update the flake8 config in tox.ini 8 years ago
Tadej Janež 1bdffbd7ea Pass TEST_FLAGS environment variable to tests run with Tox (#21611)
This allows customizing test runs when using Tox.
8 years ago
Will Thames ed52714dba Update tox.ini to match current standards
tox.ini is used for flake8 configuration in addition to tox
configuration. Update the flake8 configuration to match the
latest standards as documented in ansible/proposals#50
8 years ago
Lucas Alvares Gomes e8a94acffa Pass the HOME environment variable to testenv in tox.ini
In order to avoid the "missing HOME variable" issue when running the
unit tests, this patch is passing the HOME environment variable to
[testenv].

Fixes #20424
8 years ago
Marius Gedminas 74f07c66be Fix envlist in tox.ini
tox doesn't actually expand {brace,expressions} in envlist, so if you ran `tox` without specifying a `-e` parameter, tox would try to run `py26`, `py27`, `py3{5` and `6)`, defaulting to python2.7 for those non-standard environment names.
8 years ago
Andrii Soldatenko 5afad65895 Added py36 to tox.ini 8 years ago
Toshio Kuratomi b8a8027b7d We've decided that python-3.5 is the minimum python version (#17270) 8 years ago
Michael Scherer 42d8ababcb Start to test module_utils for python 3 syntax (#15882) 9 years ago
Toshio Kuratomi 18587842c6 Exclude the sample directory from tests 9 years ago
James Cammarata 286d91d722 Reorganizing tox stuff and making py3-specific requirements 9 years ago
Toshio Kuratomi ab44cf2a9a Start a pyflakes section to cut down on extra messages that we don't agree are problems 9 years ago
Toshio Kuratomi 63add130d4 Tox seems to not like the subsitution key for some reason 9 years ago
Marius Gedminas 43fe74f0fe Simplify tox.ini, remove outdated comment 9 years ago
Marius Gedminas bd83410bdb Enable unit tests on Python 3.4 in tox and Travis
These now pass \o/
9 years ago
Marius Gedminas a412b27604 Enable unit tests on Python 3.5
This enables the tests in tox and in Travis.  This ought to prevent
regressions in Python 3 support.

Note that Python 3.4 isn't supported (yet) because the vault code relies on
%-formatting of byte strings, a feature that was ripped out of Python 3.0
and restored in 3.5.

Also note that passing tests don't mean that Ansible itself can already
be used with Python 3.5: test coverage is only 53%.
9 years ago
Marius Gedminas f1f3bc9e50 Add Python 3.5 to tox.ini 9 years ago
Marius Gedminas e9b114a39b Simplify tox.ini
Use the factor-conditional settings feature of tox >= 1.8 to reduce
duplication:
https://tox.readthedocs.org/en/latest/config.html#factors-and-factor-conditional-settings
9 years ago
Marius Gedminas 3e0330ad3b Remove redundancies from tox.ini 9 years ago
Marius Gedminas 3f9879aedb Use print() as function under contrib/
This fixes the remaining Python 3 syntax errors, so re-enable compileall
for contrib/ again.
9 years ago
Toshio Kuratomi 1eee5ec6ff Enable py34 test in travis so we don't regress recent fixes 9 years ago
Marius Gedminas 9e82ecaf91 Disable compileall test for contrib/ in tox -e py34
(This is supposed to be temporary, until the code under contrib/ gets
cleaned up from all the remaining print statements.)
9 years ago
Marius Gedminas 0c6ce31f76 Use 'except ... as' syntax
This syntax works on Python 2.6 through 3.x.  lib/ansible/module_utils
(and lib/ansible/modules) need to support Python 2.4, so I didn't touch
those.
9 years ago
Toshio Kuratomi 3f099ca0a2 Better way to stop tox running on unwanted directories 9 years ago
Marius Gedminas b44eae9ebc Don't compile .py files under .tox/
'tox -e py26' would fail for me because python -m compileall would crawl
under .tox/py27 and, unsurprisingly, get SyntaxErrors on files from the
Python 2.7 standard library using syntax features not supported by
Python 2.6.
9 years ago
Toshio Kuratomi 87cb7f8147 Push python2.4 check into travis 9 years ago
James Cammarata 13b8a57d3d Undo previous travis/tox fixes and fix underlying issue 9 years ago
James Cammarata 7c332b63dc Updating tox script too 9 years ago
Brian Coca 29a9b8ab7d dont check vagrant inventory script for 2.6 9 years ago
Toshio Kuratomi 176b04a812 Correct typo 10 years ago
Matt Martz a0fc8bb0bd Testing additions and fixes
* Fix import pathing for units.mock
* Add some additional requirements
* Use compileall to test compatiblity with different python versions
10 years ago
Toshio Kuratomi 0da7834584 Move command for v1 back into testenv so that we have a default
(We have a jenkins build that creates a [testenv:jenkins] so it needs
there to be a default value
10 years ago
Rory Finnegan 131ce117a9 Updated the tox.ini file to run multiple ansible versions.
Purpose: so that devs can use tox to run v1 or v2 of ansible with various versions of python.
For example `tox -e py27-v2 will run python2.7 on v2. Currently, only py26 and py27 are run on v1 when
running just `tox` so that we aren't breaking builds.
10 years ago
James Laska 3d67e9e0c0 Add tox and travis-ci support
Add tox integration to run unittests in supported python releases.
Travis-CI is used for test execution.

Additionally, the unittest TestQuotePgIdentifier was updated to support
using assert_raises_regexp on python-2.6.

Sample travis-ci output available at
https://travis-ci.org/ansible/ansible/builds/54189977
10 years ago