← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1542587] [NEW] unit tests failed when change exit() to sys.exit()

 

Public bug reported:

when change exit() to sys.exit() in
keystone.cmd.cli.DomainConfigUpload.main(), the following unit tests
failed:

File "keystone/tests/unit/test_cli.py", line 357, in test_config_upload
File "keystone/tests/unit/test_cli.py", line 297, in test_no_overwrite_config
File "keystone/tests/unit/test_cli.py", line 323, in test_config_upload
File "keystone/tests/unit/test_cli.py", line 340, in test_config_upload

the log is as follow:

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "keystone/tests/unit/test_cli.py", line 357, in test_config_upload
        self.assertRaises(SystemExit, cli.DomainConfigUpload.main)
      File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 434, in assertRaises
        self.assertThat(our_callable, matcher)
      File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 445, in assertThat
        mismatch_error = self._matchHelper(matchee, matcher, message, verbose)
      File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 495, in _matchHelper
        mismatch = matcher.match(matchee)
      File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 108, in match
        mismatch = self.exception_matcher.match(exc_info)
      File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_higherorder.py", line 62, in match
        mismatch = matcher.match(matchee)
      File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 426, in match
        reraise(*matchee)
      File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 101, in match
        result = matchee()
      File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 982, in __call__
        return self._callable_object(*self._args, **self._kwargs)
      File "keystone/cmd/cli.py", line 696, in main
        sys.exit(status)
      File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py", line 1062, in __call__
        return _mock_self._mock_call(*args, **kwargs)
      File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py", line 1118, in _mock_call
        raise effect
    keystone.tests.unit.core.UnexpectedExit

** Affects: keystone
     Importance: Undecided
     Assignee: Ren Qiaowei (qiaowei-ren)
         Status: New

** Changed in: keystone
     Assignee: (unassigned) => Ren Qiaowei (qiaowei-ren)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Identity (keystone).
https://bugs.launchpad.net/bugs/1542587

Title:
  unit tests failed when change exit() to sys.exit()

Status in OpenStack Identity (keystone):
  New

Bug description:
  when change exit() to sys.exit() in
  keystone.cmd.cli.DomainConfigUpload.main(), the following unit tests
  failed:

  File "keystone/tests/unit/test_cli.py", line 357, in test_config_upload
  File "keystone/tests/unit/test_cli.py", line 297, in test_no_overwrite_config
  File "keystone/tests/unit/test_cli.py", line 323, in test_config_upload
  File "keystone/tests/unit/test_cli.py", line 340, in test_config_upload

  the log is as follow:

  Captured traceback:
  ~~~~~~~~~~~~~~~~~~~
      Traceback (most recent call last):
        File "keystone/tests/unit/test_cli.py", line 357, in test_config_upload
          self.assertRaises(SystemExit, cli.DomainConfigUpload.main)
        File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 434, in assertRaises
          self.assertThat(our_callable, matcher)
        File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 445, in assertThat
          mismatch_error = self._matchHelper(matchee, matcher, message, verbose)
        File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 495, in _matchHelper
          mismatch = matcher.match(matchee)
        File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 108, in match
          mismatch = self.exception_matcher.match(exc_info)
        File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_higherorder.py", line 62, in match
          mismatch = matcher.match(matchee)
        File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 426, in match
          reraise(*matchee)
        File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 101, in match
          result = matchee()
        File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 982, in __call__
          return self._callable_object(*self._args, **self._kwargs)
        File "keystone/cmd/cli.py", line 696, in main
          sys.exit(status)
        File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py", line 1062, in __call__
          return _mock_self._mock_call(*args, **kwargs)
        File "/opt/stack/keystone/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py", line 1118, in _mock_call
          raise effect
      keystone.tests.unit.core.UnexpectedExit

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1542587/+subscriptions


Follow ups