traceback in tests with improper cr_... file

Bug #1364449 reported by Jamie Strandboge
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Click Reviewers tools (obsolete)
Fix Released
Medium
Daniel Holbach

Bug Description

Long ago I started on a cr_tests_real.py file, but it has been superseded. However, it is still in my filesystem and not committed to bzr. With it in place and recent commits to click-reviewers-tools, the tests fail with (includes debugging print statement):

test_number_of_available_review_classes (test_modules.TestModules) ... [('ClickReviewContentHub', <class 'cr_content_hub.ClickReviewContentHub'>)]
[('ClickReviewDesktop', <class 'cr_desktop.ClickReviewDesktop'>)]
[('ClickReviewFunctional', <class 'cr_functional.ClickReviewFunctional'>)]
[('ClickReviewLint', <class 'cr_lint.ClickReviewLint'>)]
[('ClickReviewAccounts', <class 'cr_online_accounts.ClickReviewAccounts'>)]
[('ClickReviewPushHelper', <class 'cr_push_helper.ClickReviewPushHelper'>)]
[('ClickReviewScope', <class 'cr_scope.ClickReviewScope'>)]
[('ClickReviewSecurity', <class 'cr_security.ClickReviewSecurity'>)]
[]
ERROR
...
======================================================================
ERROR: test_number_of_available_review_classes (test_modules.TestModules)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jamie/bzr-pulls/click-reviewers-tools/clickreviews/tests/test_modules.py", line 26, in test_number_of_available_review_classes
    review = modules.find_main_class(module_name)
  File "/home/jamie/bzr-pulls/click-reviewers-tools/clickreviews/modules.py", line 56, in find_main_class
    init_object = getattr(module, main_class[0][0])
IndexError: list index out of range

----------------------------------------------------------------------
Ran 229 tests in 0.724s

FAILED (errors=1)

Now, I could just remove the file, but I think modules.py should probably be more resilient-- especially when considering people trying to develop new checks, etc so as not to cause any confusion. Problematic file attached.

Related branches

Revision history for this message
Jamie Strandboge (jdstrand) wrote :
Changed in click-reviewers-tools:
assignee: nobody → Daniel Holbach (dholbach)
importance: Undecided → Medium
status: New → In Progress
Changed in click-reviewers-tools:
status: In Progress → Fix Committed
Changed in click-reviewers-tools:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.