tarpas / pytest-testmon

Selects tests affected by changed files. Executes the right tests first. Continuous test runner when used with pytest-watch.
https://testmon.org
MIT License
823 stars 55 forks source link

Look at TESTMON_DATAFILE to configure datafile location #100

Closed blueyed closed 6 years ago

blueyed commented 6 years ago

I am looking into adding a "testmon" factor to pytest's tox.ini, but noticed that this should be kept per tox environment.

Therefore the tox.ini could specify:

setenv =
    testmon: TESTMON_DATAFILE={envdir}/.testmondata

There are likely other use cases where this would come in handy.

What do you think?

TODO:

[ci skip]

blueyed commented 6 years ago

I have created https://github.com/tox-dev/tox/issues/847 to have e.g. TOX_ENVDIR in the environment, which would make up for a good intermediate fallback (i.e. pytest's tox.ini would not have to define TESTMON_DATAFILE explicitly).

blueyed commented 6 years ago

@tarpas What is your opinion on this?

I am currently looking into creating a tox plugin that would/could be shipped with testmon itself, and would adjust the default location for .testmondata then to be inside of tox's current venv. This plugin could simply set this environment variable then.

tarpas commented 6 years ago

Thanks for explanation and for the code, I think it's fine.