2

I have a weird situation, in one of my class code coverage is calculated including system.debug statements and comments too. Any clue what might be causing this?

enter image description here

2 Answers 2

6

Sometimes your code coverage will be out of sync with the source. The reason for this is unknown, but fixing it is usually as simple as using Clear Code Coverage and then using Run All Tests.

1
  • This has always frustrated me. Didn't know there was a such an easy potential work around! :) Commented Jul 18, 2013 at 23:37
3

I've seen this happen before when you've run tests multiple times. I think it is getting confused with previous test runs. Try clearing out your test history and running the test again.

Setup > Develop > Apex Test Execution > View Test History and click 'Clear Test Results'

1
  • Thank you.. I cleared code coverage and the issue disappeared.
    – Yash Mehta
    Commented Jul 18, 2013 at 20:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .