Testing the ABAP unit - Why is my configuration method called twice?


I have a local class definition and implementation on a particular ABAP object for testing. I am implementing the setup and teardown methods as part of the test. Now, when I right-click on the class in transaction SE80, and click Unit Test, it runs as expected, except that it appears my setup method is being called twice, which results in failures because duplicate data is being created in the database. Has anyone seen anything like this before?

Turns out my lack of ABAP knowledge was the problem. I was using setup and teardown fixtures where I should have been using class-setup and class-teardown fixtures. The regular setup and teardown fixtures are called before EACH test method, whereas the class-setup and class-teardown are only called once before running all the test methods in the class and once afterwards.