Index: lnt/trunk/lnt/server/db/migrations/upgrade_16_to_17.py =================================================================== --- lnt/trunk/lnt/server/db/migrations/upgrade_16_to_17.py +++ lnt/trunk/lnt/server/db/migrations/upgrade_16_to_17.py @@ -7,6 +7,7 @@ from lnt.server.db.migrations.util import introspect_table from lnt.util import logger + def _mk_index_on(engine, ts_name): fc_table = introspect_table(engine, "{}_RegressionIndicator".format(ts_name)) Index: lnt/trunk/lnt/server/db/migrations/util.py =================================================================== --- lnt/trunk/lnt/server/db/migrations/util.py +++ lnt/trunk/lnt/server/db/migrations/util.py @@ -27,7 +27,7 @@ def rename_table(engine, old_name, new_name): - """Rename table wiht name \p old_name to \p new_name.""" + """Rename table with name `old_name` to `new_name`.""" # sqlite refuses to rename "BAR" to "bar" so we go # "BAR" -> "BAR_x" -> "bar" rename = _RenameTable(old_name, old_name+"_x") Index: lnt/trunk/lnt/server/db/regression.py =================================================================== --- lnt/trunk/lnt/server/db/regression.py +++ lnt/trunk/lnt/server/db/regression.py @@ -54,8 +54,8 @@ def rebuild_title(session, ts, regression): - """Update the title of a regresson.""" - if re.match("Regression of \d+ benchmarks.*", regression.title): + """Update the title of a regression.""" + if re.match(r"Regression of \d+ benchmarks.*", regression.title): old_changes = session.query(ts.RegressionIndicator) \ .filter(ts.RegressionIndicator.regression_id == regression.id) \ .all() @@ -73,7 +73,7 @@ def get_all_orders_for_machine(session, ts, machine): - """Get all the oredrs for this sa machine.""" + """Get all the orders for this sa machine.""" return session.query(ts.Order) \ .join(ts.Run) \ .filter(ts.Run.machine_id == machine) \ Index: lnt/trunk/lnt/server/db/rules/rule_update_fixed_regressions.py =================================================================== --- lnt/trunk/lnt/server/db/rules/rule_update_fixed_regressions.py +++ lnt/trunk/lnt/server/db/rules/rule_update_fixed_regressions.py @@ -41,9 +41,9 @@ machine_id = session.query(ts.Run.machine_id).filter(ts.Run.id == run_id).scalar() regression_machines = [x[0] for x in session.query(ts.FieldChange.machine_id) - .join(ts.RegressionIndicator) - .filter(ts.RegressionIndicator.regression_id == regression.id) - .all()] + .join(ts.RegressionIndicator) + .filter(ts.RegressionIndicator.regression_id == regression.id) + .all()] regression_machines_set = set(regression_machines) return machine_id in regression_machines_set @@ -54,7 +54,7 @@ """Find the oldest regressions that are still in the detected state, and age them out. This is needed when regressions are not manually acknowledged, regression analysis can grow unbounded. - + :param session: db session :param ts: testsuite :param num_to_keep: the number of newest regressions to keep in the detected state. Index: lnt/trunk/lnt/server/reporting/summaryreport.py =================================================================== --- lnt/trunk/lnt/server/reporting/summaryreport.py +++ lnt/trunk/lnt/server/reporting/summaryreport.py @@ -478,7 +478,7 @@ continue # Add to the single file stack. - stage_name, = re.match('Single File \((.*)\)', test_name).groups() + stage_name, = re.match(r'Single File \((.*)\)', test_name).groups() try: stack_index = self.single_file_stage_order.index(stage_name) except ValueError: Index: lnt/trunk/lnt/server/ui/api.py =================================================================== --- lnt/trunk/lnt/server/ui/api.py +++ lnt/trunk/lnt/server/ui/api.py @@ -61,6 +61,7 @@ """Update a dict with the common fields.""" to_update.update(common_fields_factory()) + class Fields(Resource): """List all the fields in the test suite.""" method_decorators = [in_db] @@ -71,10 +72,11 @@ result = common_fields_factory() result['fields'] = [{'column_id': i, 'column_name': f.column.name} - for i, f in enumerate(ts.sample_fields)] + for i, f in enumerate(ts.sample_fields)] return result + class Tests(Resource): """List all the tests in the test suite.""" method_decorators = [in_db] @@ -89,6 +91,7 @@ return result + class Machines(Resource): """List all the machines and give summary information.""" method_decorators = [in_db] Index: lnt/trunk/lnt/testing/__init__.py =================================================================== --- lnt/trunk/lnt/testing/__init__.py +++ lnt/trunk/lnt/testing/__init__.py @@ -447,11 +447,11 @@ raise ValueError("No 'tests' section in submission") run = data['run'] - if not 'start_time' in run: + if 'start_time' not in run: time = datetime.datetime.utcnow().replace(microsecond=0).isoformat() run['start_time'] = time run['end_time'] = time - elif not 'end_time' in run: + elif 'end_time' not in run: run['end_time'] = run['start_time'] return data