yunojuno / django-juno-testrunner

A more useful (and slightly more glamorous) test runner for Django 1.6+ from the folks at YunoJuno
MIT License
7 stars 9 forks source link

Rerunning fails if a test has been deleted or renamed #2

Open wodow opened 10 years ago

wodow commented 10 years ago

Fails with:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File ".../python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File ".../python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ".../python2.7/site-packages/django/core/management/commands/test.py", line 50, in run_from_argv
    super(Command, self).run_from_argv(argv)
  File ".../python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File ".../python2.7/site-packages/django/core/management/commands/test.py", line 71, in execute
    super(Command, self).execute(*args, **options)
  File ".../python2.7/site-packages/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File ".../python2.7/site-packages/south/management/commands/test.py", line 8, in handle
    super(Command, self).handle(*args, **kwargs)
  File ".../python2.7/site-packages/django/core/management/commands/test.py", line 88, in handle
    failures = test_runner.run_tests(test_labels)
  File ".../python2.7/site-packages/junorunner/testrunner.py", line 21, in run_tests
    suite = self.build_suite(test_labels, extra_tests)
  File ".../python2.7/site-packages/django/test/runner.py", line 63, in build_suite
    tests = self.test_loader.loadTestsFromName(label)
  File ".../python2.7/site-packages/unittest2/loader.py", line 120, in loadTestsFromName
    parent, obj = obj, getattr(obj, part)
AttributeError: type object 'MyTestCase' has no attribute 'my_test'

Fatal error: local() encountered an error (return code 1) while executing ...
stevejalim commented 10 years ago

How would you suggest/prefer this is handled. Immediate options are:

1) ignore, silently 2) display a message at the end 3) extend the final output to include mention of the missing test: (failures=4, errors=13, skipped=90, missing-from-rerun-log=2)

hugorodgerbrown commented 10 years ago

+1 for #2 - list out missing tests at the end?

stevejalim commented 10 years ago

Seems wise, yep

wodow commented 10 years ago

Sounds good.

Optional optionality: --strict could restore the current behaviour of bailing out with an error.

On 19 May 2014, at 09:56, Steve Jalim notifications@github.com wrote:

Seems wise, yep

— Reply to this email directly or view it on GitHub.