I think it would make more sense to use a ``setUpClass`` method in the test itself. See what I did for ``tests/cli/test_gpgkeys.py``.