view tests/test-doctest.py @ 18759:9baf4330d88f

sshpeer: store subprocess so it cleans up correctly When running 'hg pull --rebase', I was seeing this exception 100% of the time as the python process was closing down: Exception TypeError: TypeError("'NoneType' object is not callable",) in <bound method Popen.__del__ of <subprocess.Popen object at 0x937c10>> ignored By storing the subprocess on the sshpeer, the subprocess seems to clean up correctly, and I no longer see the exception. I have no idea why this actually works, but I get a 0% repro if I store the subprocess in self.subprocess, and a 100% repro if I store None in self.subprocess. Possibly related to issue 2240.
author Durham Goode <durham@fb.com>
date Fri, 08 Mar 2013 16:59:36 -0800
parents 0d5a22f73a1f
children f01ae031f84c
line wrap: on
line source

# this is hack to make sure no escape characters are inserted into the output
import os
if 'TERM' in os.environ:
    del os.environ['TERM']
import doctest

import mercurial.util
doctest.testmod(mercurial.util)
# Only run doctests for the current platform
doctest.testmod(mercurial.util.platform)

import mercurial.changelog
doctest.testmod(mercurial.changelog)

import mercurial.dagparser
doctest.testmod(mercurial.dagparser, optionflags=doctest.NORMALIZE_WHITESPACE)

import mercurial.match
doctest.testmod(mercurial.match)

import mercurial.store
doctest.testmod(mercurial.store)

import mercurial.ui
doctest.testmod(mercurial.ui)

import mercurial.url
doctest.testmod(mercurial.url)

import mercurial.encoding
doctest.testmod(mercurial.encoding)

import mercurial.hgweb.hgwebdir_mod
doctest.testmod(mercurial.hgweb.hgwebdir_mod)

import hgext.convert.cvsps
doctest.testmod(hgext.convert.cvsps)

import mercurial.revset
doctest.testmod(mercurial.revset)

import mercurial.minirst
doctest.testmod(mercurial.minirst)

import mercurial.templatefilters
doctest.testmod(mercurial.templatefilters)