Change the merge branch to whatever you want or need. Here is a basic runthrough of what you need to know after this is there.
Since system Python is different from Blender python you cannot share the dependencies like hamcrest and pocha by just installing them with pip. Luckly, there is an easy solution.
Assuming you are running this from your Blendkrieg directory:
Install pip
The "version" part of the path will need to be replaced with whatever version you have in the blender folder. For me it was 2.81. So, I was able to execute.
If done correctly you should have access to pocha and the likes when running python through the Blender binary.
Another challenge though. You can't run Pocha as normal (no access to args like -m). I've added a file called run-pocha.py so pocha can be used as expected when doing a non-Blender project.
/path/to/blender/blender -b --python run-pocha.py
This works as expected and fails the tests because your assert detects that this bpy is not the mock. (I checked and when disabling that assert all tests fail as they should because clear_mock doesn't exist.)
.
.
I think there should be a way to automate this. Maybe you can come up with suggestions :stuck_out_tongue:
By the way, because of how Pocha's test searching works the __init__.py hack in test/ is automatically applied whenever you run run-pocha.py through Blender.
:heart:
Change the merge branch to whatever you want or need. Here is a basic runthrough of what you need to know after this is there.
Since system Python is different from Blender python you cannot share the dependencies like hamcrest and pocha by just installing them with pip. Luckly, there is an easy solution.
Assuming you are running this from your Blendkrieg directory: Install pip
Install the dependencies.
The "version" part of the path will need to be replaced with whatever version you have in the blender folder. For me it was 2.81. So, I was able to execute.
If done correctly you should have access to pocha and the likes when running python through the Blender binary.
Another challenge though. You can't run Pocha as normal (no access to args like -m). I've added a file called run-pocha.py so pocha can be used as expected when doing a non-Blender project.
This works as expected and fails the tests because your assert detects that this bpy is not the mock. (I checked and when disabling that assert all tests fail as they should because clear_mock doesn't exist.)
.
.
I think there should be a way to automate this. Maybe you can come up with suggestions :stuck_out_tongue:
(Read the comments btw)