What’s the purpose of xfail tests?

Some test frameworks, notably DejaGnu and py.test, have an “XFAIL” flag/status for a test which says that this test is expected to fail. If the test succeeds, it’s marked as “XPASS” (unexpected pass).

Isn’t this just a redundant overcomplication? It seems much easier and comprehensible to just use an assert that would expect an error — if the error happens, the test passes, if it doesn’t, it fails.

gcc in particular is having so much trouble with this status it makes test output all but useless. I was ready to write this feature off as yet another misguided quirk of history — until I saw it in py.test.

What’s the purpose of this feature? What can it do that SKIP and asserts cannot?