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

--lg-log affects pytest's rootdir #182

Closed
kjeldflarup opened this issue Jan 25, 2018 · 3 comments
Closed

--lg-log affects pytest's rootdir #182

kjeldflarup opened this issue Jan 25, 2018 · 3 comments
Assignees
Labels

Comments

@kjeldflarup
Copy link
Contributor

Using the --lg-log option affects pytest's rootdir

(labgrid-venv) kfa@kjeld-Latitude-5580:/userdata/labgridtools/remotetests/remotetest$ pytest  --capture=sys -rs --lg-log /tmp/labgrid-log --lg-env local.yaml 
================================================================================== test session starts ==================================================================================
platform linux -- Python 3.5.2, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
rootdir: /, inifile:

The tests runs ok, but the pytest cache does not work
could not create cache path /.cache/v/cache/lastfailed
It seems like pytest sets rootdir to be the commom topdir of --lg-log and current working direktory

(labgrid-venv) kfa@kjeld-Latitude-5580:/userdata/labgridtools/remotetests/remotetest$ pytest  --capture=sys -rs --lg-log /userdata/labgridtools/remotetests/log --lg-env local.yaml 
================================================================================== test session starts ==================================================================================
platform linux -- Python 3.5.2, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
rootdir: /userdata/labgridtools/remotetests, inifile:

@Emantor
Copy link
Member

Emantor commented Feb 15, 2018

According to pytest-dev/pytest#1435 (mentioned in the pytest docs) this is indeed the case. I'm not sure how to fix that yet.

@Emantor Emantor self-assigned this Feb 15, 2018
@Emantor Emantor added the bug label Feb 15, 2018
@Emantor
Copy link
Member

Emantor commented Feb 15, 2018

Thinking further about this this is an issue of pytest. You'll have to set an explicit rootdir via one of the methods mentioned in the pytest docs, we can't change much about the fact that they iterate over all the pytest arguments to find a common rootdir.

@Emantor Emantor added upstream and removed bug labels Feb 15, 2018
@kjeldflarup
Copy link
Contributor Author

It seems that this is the way pytest works, and pytest has its own thought about it. So lets just close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants