Commit Graph

110 Commits

Author SHA1 Message Date
Zhongyue Luo 61c5597a09 Backslash continuation removal (Nova folsom-2)
Fixes bug #938588

Backslash continuations removal for scripts in bin/, plugin/, and etc.

Change-Id: Idd17048b6e8db6e939946968e011e68da8585b8d
2012-05-31 11:26:37 +08:00
Joe Gordon 7ee0d7848d Improved tools/hacking.py
* cleaner output
* fix bug 980009
* Fix N201
* N306: alphabetical order imports
* N401: docstring start
* N402: one line docstring start
* N403: multi line docstring end
* Until fixed, N40* will be disabled by default

Change-Id: I9addafdaa7a1f8fb950e14a5409f661dec6c7b87
2012-04-24 09:29:43 -07:00
Yuriy Taraday f7a6c58d92 HACKING fixes, sqlalchemy fix.
Add exceptions to hacking.py make sqlalchemy stuff legal and prevent
clutter.

Change-Id: I44b100b4c0c4dfcec81beea7aba2d8598d5a08d0
2012-04-09 18:00:40 +04:00
Andrew Bogott d1409adb0c Reordered the alphabet.
Just putting this out there... I'm pretty sure that

   import nova.flags

comes after

   from nova.endpoint import cloud

Unless I'm totally misunderstanding how this is supposed to work,
which is likely.

Change-Id: I51096ab25dbca42d73a593872b83b25f2c451210
2012-03-23 16:30:01 -05:00
Rick Harris 66e152f718 Clarify HACKING's shadow built-in guidance.
Change-Id: Icf38d3ec3254e83d2289b7b17966ec44d9757b8c
2012-03-21 21:18:46 +00:00
Johannes Erdfelt fb7d1fb825 Clear created attributes when tearing down tests
unittest will keep each test case around after completion pinning any
objects references by attributes on the test case. This can bloat
the memory used during a full test suite run to the point where
the test suite will require much more memory than running all of
the services does. On systems witout lots of memory, test suite
failures will occur as test cases cannot fork to execute programs.

Clearing out __dict__ of any attributes that don't start with a _
(since some are needed by unittest itself) reduces memory
significantly. This does require the super class tearDown to be
called last in some cases however.

Change-Id: I0e660b6c2a77c5613c5a523ba0a64c3d7f6dd128
2012-03-07 15:52:40 +00:00
Johannes Erdfelt 8813ab185d assertRaises(Exception, ...) considered harmful
Expecting that Exception is raised can end up passing an a test when an
unexpected error occurs. For instance, errors in the unit test itself
can be masked:

https://review.openstack.org/4848
https://review.openstack.org/4873
https://review.openstack.org/4874

Change a variety of unit tests to expect a more specific exception so
we don't run into false positive tests in the future.

Change-Id: Ibc0c63b1f6b5574a3ce93d9f02c9d1ff5ac4a8b0
2012-03-04 17:22:36 +00:00
Mark McLoughlin 259d3e356b Update cfg from openstack-common
Use openstack-common's update.py script to pull in some recent changes:

 * Add the Mapping interface to cfg.ConfigOpts
 * Add support to cfg for disabling interspersed args

Make use of both of these in nova/flags.py.

Add some dire warnings to HACKING about directly modifying the copy of
openstack-common code. I'm confident they won't be ignored :-)

Change-Id: I7ef75d18922c0bbb8844453b48cad0418034bc11
2012-02-07 21:35:30 +00:00
Kevin L. Mitchell 35e98d55db Update HACKING.rst.
Removes the requirement for a trailing blank line in multiline
docstrings, just before the closing '"""'.  This blank line is not
needed anymore, as the editors it was recommended for no longer
have the problem that this blank line was working around.

Change-Id: I4e532231f1d99e9f5048cbfcc791a4328fb1e8f5
2012-01-05 10:21:57 -06:00
Duncan McGreggor f845891184 First steps towards consolidating testing infrastructure
This commit begins to implement blueprint consolidate-testing-infrastructure by
adding a 'testing' subpackage and moving some modules into it.

Change-Id: I04bf860bc386bd2016e7dbc5a6f6ef7379a855bb
2011-12-06 09:37:57 -08:00