---
title: tearDown()
framework: xctest
role: symbol
role_heading: Type Method
path: xctest/xctestcase/teardown()
---

# tearDown()

Provides an opportunity to perform cleanup after a test case ends.

## Declaration

```swift
class func tearDown()
```

## Mentioned in

Set Up and Tear Down State in Your Tests

## Discussion

Discussion The tearDown() class method is called exactly once for a test case, after its final test method completes. Override this method to perform any cleanup after all test methods have ended.

## See Also

### Related Documentation

- [tearDown()](xctest/xctest/teardown().md)

### Customizing Test Setup and Teardown

- [Set Up and Tear Down State in Your Tests](xctest/set-up-and-tear-down-state-in-your-tests.md)
- [setUp()](xctest/xctestcase/setup().md)
- [addTeardownBlock(_:)](xctest/xctestcase/addteardownblock(_:)-2guon.md)
- [addTeardownBlock(_:)](xctest/xctestcase/addteardownblock(_:)-5zw6c.md)
