Skip to content

docs: remove extra characters in the command line prompt #5153

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

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 2 additions & 0 deletions changelog/5153.trivial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove extra characters in the shown command line prompts in the test discovery
documentation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw: I do not think we need a changelog for this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

me neither. creating this was pain via github.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/pytest-dev/pytest/blob/master/changelog/README.rst

trivial: fixing a small typo or internal change that might be noteworthy.

Note sure if the "might be noteworthy" part applies to fixing typos, but I think this list should be updated to say not to create this just for a trivial typo fix.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh excellent point, thanks for pointing that out! We should update that templates to mean that trivial is meant to actual code or dependency changes, but not to small documentation changes in general. 👍

4 changes: 2 additions & 2 deletions doc/en/example/pythoncollection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ You can always peek at the collection tree without running tests like this:

.. code-block:: pytest

. $ pytest --collect-only pythoncollection.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are there to not run regendoc, because regendoc uses the line starting as $ to mean to execute the shell command:

https://github.com/pytest-dev/regendoc/blob/27e3652723659d8b2d7a5311567480fccc49cbe2/regendoc/parse.py#L82-L84

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this PR is probably bogus. Should I open an issue to have a mechanism for this that doesn't uglify the docs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I would kindly ask to create it in https://github.com/pytest-dev/regendoc though. 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are there to not run regendoc

Why though? Shouldn't we have working examples for those also?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, probably they should

$ pytest --collect-only pythoncollection.py
=========================== 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
Expand Down Expand Up @@ -266,7 +266,7 @@ leave out the ``setup.py`` file:

.. code-block:: pytest

#$ pytest --collect-only
$ pytest --collect-only
====== test session starts ======
platform linux2 -- Python 2.7.10, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
Expand Down