import unittest


def filter_tests(suite):
    """Make a new TestSuite from `suite`, removing test classes
    with names starting with '_'."""
    result = unittest.TestSuite()
    for test in suite:
        if isinstance(test, unittest.TestSuite):
            result.addTest(filter_tests(test))
        elif not test.__class__.__name__.startswith("_"):
            result.addTest(test)
    return result