Uberi / Yunit

Super simple testing framework for AutoHotkey.
GNU Affero General Public License v3.0
53 stars 21 forks source link

__new and __delete are called as tests #26

Closed Lexikos closed 4 years ago

Lexikos commented 5 years ago

In addition, the special class methods New() and Delete() are called before testing starts on a category and after it finishes, respectively.

I considered using this to remove some test methods from the new instance if certain conditions aren't met. However, it seems that __new and __delete are not excluded from the testing; i.e. they are assumed to be test methods, are called again, and shown in the results.

My idea wouldn't work anyway, since the methods are in the class, not the instance.

Instead, I can work around it and also achieve what I was after by overriding _NewEnum.

Lexikos commented 5 years ago

Related: __init is also called as a test.

__init might be used to set ExpectedException (which seems to be undocumented) for a class of tests that should all throw the same exception.

Instead, ExpectedException can be set by each test.

mmikeww commented 4 years ago

I've excluded New and Delete from being called as tests, and updated the v2 branch to work with a108 after merging in your a104 fixes