kvas-it / pytest-console-scripts

Pytest plugin for testing console scripts
MIT License
78 stars 14 forks source link

Tests are trying to write to /usr/lib/python3.6/site-packages/ #11

Closed cryptomilk closed 6 years ago

cryptomilk commented 6 years ago

Tests are trying to write to /usr/lib/python3.6/site-packages/ and get: Permission denied.

I think they need to be adapted to not write to the directory they are executed in ...

See: https://build.opensuse.org/package/show/home:gladiac/python-pytest-console-scripts

Log: https://build.opensuse.org/package/live_build_log/home:gladiac/python-pytest-console-scripts/openSUSE_Tumbleweed/x86_64

kvas-it commented 6 years ago

Yes, this sounds like an error in design of the tests. All writing should be in temporary directories.

kvas-it commented 6 years ago

I did some initial investigation (see here) and I have half of a plan of how to fix it. Any advice would be welcome.

cryptomilk commented 6 years ago

Any news?

kvas-it commented 6 years ago

I didn't get any better advice than to use pytest-virtualenv. I will try rewriting the tests to use this hopefully this week.

cryptomilk commented 6 years ago

I'm back from my vacation. Has this been addressed already?

kvas-it commented 6 years ago

Hi Andreas, Unfortunately I have been quite busy in all this time and wasn't able to prioritize this. Still not done, sorry.

cryptomilk commented 6 years ago

Any news?

kvas-it commented 6 years ago

Hi Andreas! I have implemented a virtualenv-based solution to this ticket. Could you check if the tests now pass in your environment?