nangtani / blender-addon-tester

The blender addon tester is a test harness to enable pytest hook to allow addons to be tested inside a defined version of blender.
MIT License
64 stars 13 forks source link

Fix code coverage #10

Open douglaskastle opened 4 years ago

douglaskastle commented 4 years ago

Code cover in this project is slightly irrelevant. Consider removing.

When this code is being used to enable addon testing, it is the addon that needs the code coverage, not anything from here.

It's presence here might be confusing.

It should definitely be in the new form blender-fake-addon.

Thought?

myselfhimself commented 4 years ago

I had disabled code coverage from the entry point function. It can be enabled from the input config dictionary.

The entry point function is this one: https://github.com/douglaskastle/blender-addon-tester/blob/c6e5499d68ce8fe0faf7a96e8a7853b9ecf83176/blender_addon_tester/__init__.py#L4

An example of enabled coverage through a config dict toggling parameter is here: https://github.com/douglaskastle/blender-addon-tester/blob/c6e5499d68ce8fe0faf7a96e8a7853b9ecf83176/examples/testing-fake-addon/test_fake_addon_blender_advanced.py#L13

I have always favored creativity over test coverage perfection. Putting coverage tests on any project is new to me. I will not encourage or discourage that. :)

douglaskastle commented 4 years ago

You are mostly right about coverage, when it is your own code. When you try and write tests for code you didn't write, coverage is invaluable. It gives you a lot of guidance and areas of testing you are missing.

I know TDD mandates that all tests should be written before the code is written. In my world the code exists already and the tests usually come in months later.

Any way the mandate here is to enable the act, not do the act. (though I may add coverage to all the code in this repo)