Uberi/Yunit

__new and __delete are called as tests

Lexikos opened this issue · 2 comments

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.

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.

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