Skip to content

Substituted 'yml' to '.yaml' in relevant files #5540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions doc/en/example/nonpython.rst
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# test_simple.yml
# test_simple.yaml
ok:
sub1: sub1

Expand Down