mirror of
https://github.com/certbot/certbot.git
synced 2026-06-09 00:32:12 -04:00
Fix noisy tests (#6004)
* Fixes #5570. The issue is calls to atexit aren't mocked out. During the tests there are many repeated calls registering functions to be called when the process exits so when the tests finishes, it prints a ton of output from running those registered functions. This suppresses that by mocking out atexit. * Mock at a lower level. This ensures we don't mess with any other mocks in this test class by mocking at the lowest level we can. Other tests shouldn't be mocking out specific internals of functions in other modules, so this should work just fine.
This commit is contained in:
parent
722dac86d5
commit
41e1976c17
1 changed files with 2 additions and 1 deletions
|
|
@ -626,7 +626,8 @@ class MainTest(test_util.ConfigTestCase): # pylint: disable=too-many-public-met
|
|||
toy_stdout = stdout if stdout else six.StringIO()
|
||||
with mock.patch('certbot.main.sys.stdout', new=toy_stdout):
|
||||
with mock.patch('certbot.main.sys.stderr') as stderr:
|
||||
ret = main.main(args[:]) # NOTE: parser can alter its args!
|
||||
with mock.patch("certbot.util.atexit"):
|
||||
ret = main.main(args[:]) # NOTE: parser can alter its args!
|
||||
return ret, toy_stdout, stderr
|
||||
|
||||
def test_no_flags(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue