Pytest: improving example output (rootdir: $REGENDOC_TMPDIR)?

Created on 14 Jun 2018  路  13Comments  路  Source: pytest-dev/pytest

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?

easy docs infrastructure

All 13 comments

GitMate.io thinks a possibly related issue is https://github.com/pytest-dev/pytest/issues/62 (better html output for examples (sphinx highlighter)).

Hi @obestwalter,

I agree that using a real path would be better.

I thought this would be configured here:

https://github.com/pytest-dev/pytest/blob/4d0297b4138b694e1d99f4c8147aaf06d725d0f4/doc/en/Makefile#L15-L23

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

@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

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

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

Oh right, even better then 馃榿

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).

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

edit: s/sine/since/

@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?

/path/to/example

Also good :)

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

Was this page helpful?
0 / 5 - 0 ratings