Skip to content
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

improving example output (rootdir: $REGENDOC_TMPDIR)? #3580

Closed
obestwalter opened this issue Jun 14, 2018 · 13 comments
Closed

improving example output (rootdir: $REGENDOC_TMPDIR)? #3580

obestwalter opened this issue Jun 14, 2018 · 13 comments
Labels
good first issue easy issue that is friendly to new contributor type: docs documentation improvement, missing or needing clarification type: infrastructure improvement to development/releases/CI structure

Comments

@obestwalter
Copy link
Member

obestwalter commented Jun 14, 2018

Since 2.8 example output looks like this:

======= test session starts ========
platform linux -- Python 3.4.3, pytest-2.8.7, py-1.4.31, pluggy-0.3.1
rootdir: $REGENDOC_TMPDIR, inifile:
collected 0 items
======= no tests ran in 0.12 seconds ========

before it looked like this:

=========================== test session starts ============================
platform linux -- Python 3.4.1 -- py-1.4.27 -- pytest-2.7.1
rootdir: /tmp/doc-exec-162, inifile:
collected 0 items

This is basically a cosmetic thing, but I think it would be better to have something looking like a real path there again to decrease the confusion potential - especially for newcomers.

Might also be an easy first issue for someone wanting to make themselves familiar with some of pytests build tools?

@pytestbot
Copy link
Contributor

GitMate.io thinks a possibly related issue is #62 (better html output for examples (sphinx highlighter)).

@nicoddemus nicoddemus added the type: docs documentation improvement, missing or needing clarification label Jun 14, 2018
@nicoddemus
Copy link
Member

Hi @obestwalter,

I agree that using a real path would be better.

I thought this would be configured here:

pytest/doc/en/Makefile

Lines 15 to 23 in 4d0297b

REGENDOC_ARGS := \
--normalize "/in \d+.\d+ seconds/in 0.12 seconds/" \
--normalize "@/tmp/pytest-of-.*/pytest-\d+@PYTEST_TMPDIR@" \
--normalize "@pytest-(\d+)\\.[^ ,]+@pytest-\1.x.y@" \
--normalize "@(This is pytest version )(\d+)\\.[^ ,]+@\1\2.x.y@" \
--normalize "@py-(\d+)\\.[^ ,]+@py-\1.x.y@" \
--normalize "@pluggy-(\d+)\\.[.\d,]+@pluggy-\1.x.y@" \
--normalize "@hypothesis-(\d+)\\.[.\d,]+@hypothesis-\1.x.y@" \
--normalize "@Python (\d+)\\.[^ ,]+@Python \1.x.y@"

But it doesn't seem to be the case. I'm sure @RonnyPfannschmidt knows where this is configured though.

@RonnyPfannschmidt
Copy link
Member

@obestwalter at each execution its a different folder, thats simpy not directly usable

im happy to accept a pr to regendoc to fix this to something more visually pleasing

@nicoddemus
Copy link
Member

Yeah, I think the idea is to hard-code a folder: /tmp/regendoc for example

@nicoddemus nicoddemus added the type: infrastructure improvement to development/releases/CI structure label Jun 14, 2018
@nicoddemus nicoddemus added the good first issue easy issue that is friendly to new contributor label Jun 14, 2018
@RonnyPfannschmidt
Copy link
Member

@nicoddemus its already on github https://github.com/pytest-dev/regendoc/

@nicoddemus
Copy link
Member

Oh right, even better then 😁

@obestwalter
Copy link
Member Author

If all occurrences can be replaced with something generic I would go for something like /path/to/project to make clear that this is a generic example folder in a documentation snippet (and that the root is usually the root of your project).

@RonnyPfannschmidt
Copy link
Member

RonnyPfannschmidt commented Jun 15, 2018

@obestwalter i disagree, since its not the project dir in that case

edit: s/sine/since/

@nicoddemus
Copy link
Member

@RonnyPfannschmidt sorry, what do you mean by sine?

rootdir: $REGENDOC_TMPDIR, inifile:

I agree with @obestwalter that rootdir: /path/to/project seems appropriate... do you have another thing in mind?

@RonnyPfannschmidt
Copy link
Member

/path/to/example

@obestwalter
Copy link
Member Author

Also good :)

@obestwalter
Copy link
Member Author

Thanks for the fix @aswinm - closing this then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue easy issue that is friendly to new contributor type: docs documentation improvement, missing or needing clarification type: infrastructure improvement to development/releases/CI structure
Projects
None yet
Development

No branches or pull requests

4 participants