[3.5] bpo-38243, xmlrpc.server: Escape the server_title (GH-16373) (GH-16441) by vstinner · Pull Request #16516 · python/cpython
Minor readability recommendation to use serv = self.serv:
def test_server_title_escape(self): # bpo-38243: Ensure that the server title and documentation # are escaped for HTML. serv = self.serv serv.set_server_title('test_title<script>') serv.set_server_documentation('test_documentation<script>') self.assertEqual('test_title<script>', serv.server_title) self.assertEqual('test_documentation<script>', serv.serv_documentation) generated = serv.generate_html_documentation() # ...
This isn't at all critical as far as functionality goes, but it makes it easier to read by reducing some of the white noise. This is frequently done in other areas, such as the asyncio tests. For example, loop = self.loop; loop.create_future() instead of self.loop.create_future(), when the same instance attribute is repeatedly referenced (generally 3+ times, in this case it's 5).
Edit: Never mind, this would have been addressed in the original PR #16373 and not just for the backport. It's probably not important enough to be worth adjusting separately. I only saw this specific PR because of the message from @vstinner in python-dev.