This looks like duplicate code from `tests/unit/__init__.py`.  Was there a reason we can't just use that code?