yoda
yoda copied to clipboard
Yoda diary add notes and tasks outside virtualenv
What are the steps to reproduce this issue?
- … source into venv
- … run coverage test in a dev build
- … deactivate from venv
- ... yoda diary notes / yoda diary tasks
What happens?
… The tests add test notes into the diary
What were you expecting to happen?
… Shouldn't the diary be environment dependable? I mean, if I'm developing a new feature and I want to test it, it adds notes to my 'personal use' yoda outside the virtualenv. And then when I want to use the diary to keep track of my tasks, there is a lot of garbage from the testing. ... Also, it seems that installing yoda again does not clean the diary notes.
Enhancement idea:
... I don't know where the diary is being stored, but is there a way to store in a place that is not the same for all virtualenvs?
@vccolombo yes you're right.
I didn't think of that while writing the tests. This also applies while running some other tests, like the ones for flashcards
, define
etc.
We need to create dummy data for tests so that the original config is not disturbed.
Regarding your Enhancement idea
, yes, It's possible to implement that too, but it's not there yet.
I think all you need to do is to run tests within a test directory and delete the directory afterwards. Since all the data are currently stored in files and there is no option to delete them, running the tests automatically adds garbage data to the local instance.
So before starting the tests, we should create a test subdirectory and change these values accordingly: YODA_CONFIG_FILE_PATH = os.path.join(os.path.expanduser('~'), '.yodaconfig') DEFAULT_CONFIG_PATH = os.path.join(os.path.expanduser('~'), '.yoda')
After running the tests, the directories would be simply deleted.