Skip to content

Commit

Permalink
Try to change into examples/ for test.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Feb 14, 2021
1 parent bcabd6f commit e788495
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/TestExamples.py
Expand Up @@ -4,10 +4,17 @@
from ansiblelint.runner import Runner


def test_example(default_rules_collection):
@pytest.fixture(scope="function")
def change_into_examples_dir(request):
os.chdir('examples')
yield
os.chdir('..')


def test_example(default_rules_collection, change_into_examples_dir):
"""example.yml is expected to have 15 match errors inside."""
result = Runner(
'examples/playbooks/example.yml', rules=default_rules_collection
'playbooks/example.yml', rules=default_rules_collection
).run()
assert len(result) == 15

Expand Down

0 comments on commit e788495

Please sign in to comment.