diff --git a/keystoneclient/tests/test_shell.py b/keystoneclient/tests/test_shell.py index 4be563b02..65cba9dbd 100644 --- a/keystoneclient/tests/test_shell.py +++ b/keystoneclient/tests/test_shell.py @@ -37,6 +37,11 @@ DEFAULT_TENANT_NAME = 'tenant_name' DEFAULT_AUTH_URL = 'http://127.0.0.1:5000/v2.0/' +# Make a fake shell object, a helping wrapper to call it +def shell(cmd): + openstack_shell.OpenStackIdentityShell().main(cmd.split()) + + class NoExitArgumentParser(argparse.ArgumentParser): def error(self, message): raise exceptions.CommandError(message) @@ -68,12 +73,6 @@ class ShellTest(utils.TestCase): self.useFixture(fixtures.EnvironmentVariable(var, self.FAKE_ENV[var])) - # Make a fake shell object, a helping wrapper to call it, and a quick - # way of asserting that certain API calls were made. - global shell, _shell, assert_called, assert_called_anytime - _shell = openstack_shell.OpenStackIdentityShell() - shell = lambda cmd: _shell.main(cmd.split()) - def test_help_unknown_command(self): self.assertRaises(exceptions.CommandError, shell, 'help %s' % uuid.uuid4().hex) diff --git a/tox.ini b/tox.ini index b3e1d5d25..49586a554 100644 --- a/tox.ini +++ b/tox.ini @@ -31,12 +31,11 @@ downloadcache = ~/cache/pip commands = oslo_debug_helper -t keystoneclient/tests {posargs} [flake8] -# F821: undefined name # H304: no relative imports # H405: multi line docstring summary not separated with an empty line # E122: continuation line missing indentation or outdented # New from hacking 0.10: H238 -ignore = F821,H238,H304,H405,E122 +ignore = H238,H304,H405,E122 show-source = True exclude = .venv,.tox,dist,doc,*egg,build,*openstack/common*