def METHOD_NAME(self):
    orig_stderr = sys.stderr
    orig_stdout = sys.stdout
    stderr = sys.stderr = StringIO()
    stdout = sys.stdout = StringIO()
    try:
        print_version()
    finally:
        sys.stdout = orig_stdout
        sys.stderr = orig_stderr
    stdout = stdout.getvalue()
    stderr = stderr.getvalue()
    from .. import __version__ as version
    self.assertIn(version, stdout)
    if stderr:  # Depends on os.fstat(1/2).
        self.assertIn(version, stderr)