<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openstack/python-troveclient.git/troveclient/compat/tests/__init__.py, branch queens-eol</title>
<subtitle>opendev.org: openstack/python-troveclient.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-troveclient.git/'/>
<entry>
<title>Include troveclient/compat/tests in testr</title>
<updated>2013-10-22T22:53:45+00:00</updated>
<author>
<name>Kui Shi</name>
<email>skuicloud@gmail.com</email>
</author>
<published>2013-10-19T07:46:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-troveclient.git/commit/?id=31a6cde05289894579fad328ed104bb5bedb46c9'/>
<id>31a6cde05289894579fad328ed104bb5bedb46c9</id>
<content type='text'>
All tests should be included in testr.

In test_common.py, the testr command line will be read for parsing,
finally emit error message:
run.py: error: no such option: -t

we should mock the sys.argv in setUp().

The analysis is here
--------------------
troveclient/compat/common.py: CommandsBase
254     def _parse_options(self, parser):
255         opts, args = parser.parse_args()  &lt;-- 1. no arg is passed

/usr/lib/python2.7/optparse.py
1361     def _get_args(self, args):
1362         if args is None:
1363             return sys.argv[1:]  &lt;-- 3. cmdline(testr command) is read
1364         else:
1365             return args[:]

1367     def parse_args(self, args=None, values=None):
...
1381         rargs = self._get_args(args) &lt;-- 2. args is None

Close-Bug #1241845

Change-Id: I092db96d1b6bb31c41e6ba4c5fc9606e3f8ac087
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All tests should be included in testr.

In test_common.py, the testr command line will be read for parsing,
finally emit error message:
run.py: error: no such option: -t

we should mock the sys.argv in setUp().

The analysis is here
--------------------
troveclient/compat/common.py: CommandsBase
254     def _parse_options(self, parser):
255         opts, args = parser.parse_args()  &lt;-- 1. no arg is passed

/usr/lib/python2.7/optparse.py
1361     def _get_args(self, args):
1362         if args is None:
1363             return sys.argv[1:]  &lt;-- 3. cmdline(testr command) is read
1364         else:
1365             return args[:]

1367     def parse_args(self, args=None, values=None):
...
1381         rargs = self._get_args(args) &lt;-- 2. args is None

Close-Bug #1241845

Change-Id: I092db96d1b6bb31c41e6ba4c5fc9606e3f8ac087
</pre>
</div>
</content>
</entry>
</feed>
