Move capture() context manager to fixtures.py