1. 18 9月, 2015 1 次提交
  2. 15 9月, 2015 1 次提交
    • L
      avocado.core.test: Avoid passing ugly exceptions · 73c8cefb
      Lukáš Doktor 提交于
      Currently when one passes exception, which is not instance of Exception,
      avocado proceeds and returns "INTERRUPTED" test instead of "ERROR". This
      for example happens when old-style-class is used as exception. This
      patch uses pure "except" without any argument to catch such exceptions
      and then it wraps them in "exceptions.TestError" instead.
      
      The same applies to "setUp" and "tearDown", they only use different
      class as a wrapper.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      73c8cefb
  3. 18 6月, 2015 1 次提交
  4. 09 6月, 2015 1 次提交
    • C
      API review: move avocado.test to avocado.core.test and expose avocado.Test · 08810698
      Cleber Rosa 提交于
      Only avocado.Test is of general interest to test writers. For that reason
      the entire test module has been moved to the avocado.core namespace.
      
      The recommended way to go about writing instrumented tests is something like:
      
         from avocado import Test
         class MyTest(Test):
            def test_foo(self):
               do_stuff()
      
      Changes from v2:
      * Fixed references in docstrings
      * Fixed refrences of avocado.test in Writing Test Guide docs
      
      Changes from v1:
      * Fixed comment typo on commit message
      * Fixed old reference of avocado.test (then test.Test) instead of
        avocado then Test in GDB docs.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      08810698
  5. 24 4月, 2015 2 次提交
  6. 07 4月, 2015 1 次提交
  7. 04 3月, 2015 1 次提交
    • L
      avocado.test: Fortify avocado before very nasty exceptions · fda1dde4
      Lukáš Doktor 提交于
      The NastyException error is back:
      
      class NastyException(Exception):
          def __init__(self, msg):
              self.msg = msg
          def __str__(self):
              return self.msg
      
      crashes Avocado. The problem is we are trying to re-raise the exceptions
      and then read the traceback again. Even reading of the details of this
      very nasty written exception causes critical failure.
      
      What this patch does instead of handling issues wherever we produce
      them, it waits till the exception bubbles to the entry-point and it
      tries to read it. If it fails, we log the original traceback
      (information about the failure) and then user-friendly message saying
      we're unable to retrieve the original failure.
      
      Additionally I had to modify the xunit output as in case of very nasty
      inputs it's unable to reproduce the values.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      fda1dde4