Skip to content

Commit

Permalink
Merge pull request #5540 from bazcrown/yml2yaml
Browse files Browse the repository at this point in the history
Substituted 'yml' to '.yaml' in relevant files
  • Loading branch information
asottile committed Jul 3, 2019
2 parents d74a975 + 1b0e8d7 commit 776a632
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions doc/en/example/nonpython.rst
Expand Up @@ -12,29 +12,29 @@ A basic example for specifying tests in Yaml files
.. _`pytest-yamlwsgi`: http://bitbucket.org/aafshar/pytest-yamlwsgi/src/tip/pytest_yamlwsgi.py
.. _`PyYAML`: https://pypi.org/project/PyYAML/

Here is an example ``conftest.py`` (extracted from Ali Afshnars special purpose `pytest-yamlwsgi`_ plugin). This ``conftest.py`` will collect ``test*.yml`` files and will execute the yaml-formatted content as custom tests:
Here is an example ``conftest.py`` (extracted from Ali Afshnars special purpose `pytest-yamlwsgi`_ plugin). This ``conftest.py`` will collect ``test*.yaml`` files and will execute the yaml-formatted content as custom tests:

.. include:: nonpython/conftest.py
:literal:

You can create a simple example file:

.. include:: nonpython/test_simple.yml
.. include:: nonpython/test_simple.yaml
:literal:

and if you installed `PyYAML`_ or a compatible YAML-parser you can
now execute the test specification:

.. code-block:: pytest
nonpython $ pytest test_simple.yml
nonpython $ pytest test_simple.yaml
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y
cachedir: $PYTHON_PREFIX/.pytest_cache
rootdir: $REGENDOC_TMPDIR/nonpython
collected 2 items
test_simple.yml F. [100%]
test_simple.yaml F. [100%]
================================= FAILURES =================================
______________________________ usecase: hello ______________________________
Expand Down Expand Up @@ -69,8 +69,8 @@ consulted when reporting in ``verbose`` mode:
rootdir: $REGENDOC_TMPDIR/nonpython
collecting ... collected 2 items
test_simple.yml::hello FAILED [ 50%]
test_simple.yml::ok PASSED [100%]
test_simple.yaml::hello FAILED [ 50%]
test_simple.yaml::ok PASSED [100%]
================================= FAILURES =================================
______________________________ usecase: hello ______________________________
Expand All @@ -93,7 +93,7 @@ interesting to just look at the collection tree:
rootdir: $REGENDOC_TMPDIR/nonpython
collected 2 items
<Package $REGENDOC_TMPDIR/nonpython>
<YamlFile test_simple.yml>
<YamlFile test_simple.yaml>
<YamlItem hello>
<YamlItem ok>
Expand Down
2 changes: 1 addition & 1 deletion doc/en/example/nonpython/conftest.py
Expand Up @@ -3,7 +3,7 @@


def pytest_collect_file(parent, path):
if path.ext == ".yml" and path.basename.startswith("test"):
if path.ext == ".yaml" and path.basename.startswith("test"):
return YamlFile(path, parent)


Expand Down
@@ -1,4 +1,4 @@
# test_simple.yml
# test_simple.yaml
ok:
sub1: sub1

Expand Down

0 comments on commit 776a632

Please sign in to comment.