1. 30 4月, 2018 2 次提交
  2. 28 4月, 2018 2 次提交
  3. 26 4月, 2018 1 次提交
  4. 25 4月, 2018 4 次提交
    • C
      selftests/unit/test_utils_process.py: syntax fix for skipUnless · 6c9fb563
      Cleber Rosa 提交于
      Commit 33517beb has a syntax
      failure because reason is a mandatory argument.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      6c9fb563
    • C
      Merge branch 'travis_errors' · ed308af4
      Cleber Rosa 提交于
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      ed308af4
    • C
      selftests/unit/test_utils_process.py: skip test if sudo is not available · 33517beb
      Cleber Rosa 提交于
      test_run_sudo() actually needs sudo, because it attempts to run it.
      Let's check for the file at the usual location, and skip the test
      unless it exists.
      
         ERROR: test_run_sudo (selftests.unit.test_utils_process.TestProcessRun)
         ----------------------------------------------------------------------
         Traceback (most recent call last):
           File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
             return func(*args, **keywargs)
           File "selftests/unit/test_utils_process.py", line 180, in test_run_sudo
             p = process.run(cmd='ls -l', sudo=True, ignore_status=True)
           File "avocado/utils/process.py", line 1272, in run
             cmd_result = sp.run(timeout=timeout)
           File "avocado/utils/process.py", line 781, in run
             self._init_subprocess()
           File "avocado/utils/process.py", line 571, in _init_subprocess
             raise details
         OSError: [Errno 2] No such file or directory (/bin/sudo -n ls -l)
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      33517beb
    • C
      avocado.utils.astring: ignore "undefined" unicode · 6066c74d
      Cleber Rosa 提交于
      Depending on the Python version stack being used *by inspekt*, it
      can produce this error:
      
         Syntax check FAIL
         ************* Module avocado.utils.astring
         E0602:305,32: is_text: Undefined variable 'unicode'
      
      Let's disable that check, since that variable is a reserved word
      that should always exist in Python 2.7, for which a conditional
      exists.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      6066c74d
  5. 24 4月, 2018 1 次提交
  6. 23 4月, 2018 6 次提交
  7. 21 4月, 2018 14 次提交
  8. 20 4月, 2018 2 次提交
    • A
      DataSize: replace __getattr__ and __dir__ by actual properties · 970d850a
      Amador Pahim 提交于
      We loose in flexibility by the performance improvement justifies the
      change. Since __getattr__ is the last resource python tries to solve
      attributes, creating the actual properties makes the resolution to
      happen earlier and the performance to be way better.
      
      Before this patch:
      
      >>> timeit.timeit('data_structures.DataSize("1M").b',
                        setup='from avocado.utils import data_structures',
                        number=1000000)
      >>> 2.0695440769195557
      
      After this patch:
      
      >>> timeit.timeit('data_structures.DataSize("1M").b',
                        setup='from avocado.utils import data_structures',
                        number=1000000)
      >>> 1.1383171081542969
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      970d850a
    • A
      DataSize: simplify __init__ · 5a1b7133
      Amador Pahim 提交于
      Instead of using regex to parse the `data`, let's use a simpler and more
      performatic version witch just handles the last character to figure out
      the unit.
      
      Before this patch:
      
      >>> timeit.timeit('data_structures.DataSize("1M").b',
                        setup='from avocado.utils import data_structures',
                        number=1000000)
      >>> 2.988218069076538
      
      After this patch:
      
      >>> timeit.timeit('data_structures.DataSize("1M").b',
                        setup='from avocado.utils import data_structures',
                        number=1000000)
      >>> 2.0695440769195557
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      5a1b7133
  9. 19 4月, 2018 6 次提交
  10. 18 4月, 2018 2 次提交