1. Michael Bayer
  2. dogpile.cache
  3. Pull requests

Pull requests

#33 Merged
Repository
sontek
Branch
use_tox_pytest
Repository
zzzeek
Branch
master

Use pytest + tox for running tests

Author
  1. sontek
Reviewers
Description

This introduces a tox.ini and the use of pytest instead of nose. This gives a much nicer output:

tests/cache/plugins/test_mako_cache.py::TestMakoPlugin::test_basic PASSED
tests/cache/plugins/test_mako_cache.py::TestMakoPlugin::test_timeout PASSED
------------------------------------------------------------------------------ coverage: platform linux2, python 2.7.9-final-0 ------------------------------------------------------------------------------
Name                               Stmts   Miss  Cover   Missing
----------------------------------------------------------------
dogpile/cache/__init__                 2      0   100%   
dogpile/cache/api                     21      0   100%   
dogpile/cache/backends/__init__        9      0   100%   
dogpile/cache/backends/file          154     22    86%   155, 165, 178-181, 183-184, 225-228, 300, 351, 359, 367, 375, 383, 405, 434, 442-443
dogpile/cache/backends/memcached     109     41    62%   28-29, 32-43, 46-47, 114, 118, 143-146, 149-153, 156-157, 170, 176, 179, 245, 278, 326-339, 342, 350-351
dogpile/cache/backends/memory         33      0   100%   
dogpile/cache/backends/null           24      0   100%   
dogpile/cache/backends/redis          63     45    29%   95-108, 116-134, 137-141, 144-147, 150-153, 158-162, 165-176, 179, 182
dogpile/cache/compat                  29      4    86%   12-13, 55, 64
dogpile/cache/exception                4      0   100%   
dogpile/cache/plugins/__init__         0      0   100%   
dogpile/cache/plugins/mako_cache      29     10    66%   55-56, 64-65, 70-71, 83, 86-87, 90
dogpile/cache/proxy                   22      0   100%   
dogpile/cache/region                 291      5    98%   272, 640-641, 714, 1026
dogpile/cache/util                   113     11    90%   78, 100, 104, 112, 120-125, 137, 145
----------------------------------------------------------------
TOTAL                                903    138    85%   
Coverage XML written to file coverage.xml
========================================================================================== short test summary info ==========================================================================================
SKIP [1] /home/sontek/venvs/pymemcache/src/dogpile.cache/tests/cache/__init__.py:45: Python 3 required
SKIP [46] /home/sontek/venvs/pymemcache/src/dogpile.cache/tests/cache/_fixtures.py:22: Backend dogpile.cache.pylibmc not installed
SKIP [46] /home/sontek/venvs/pymemcache/src/dogpile.cache/tests/cache/_fixtures.py:22: Backend dogpile.cache.memcached not installed
SKIP [46] /home/sontek/venvs/pymemcache/src/dogpile.cache/tests/cache/_fixtures.py:22: Backend dogpile.cache.bmemcached not installed
SKIP [6] /home/sontek/venvs/pymemcache/src/dogpile.cache/tests/cache/test_redis_backend.py:57: Backend dogpile.cache.redis not installed
SKIP [25] /home/sontek/venvs/pymemcache/src/dogpile.cache/tests/cache/_fixtures.py:22: Backend dogpile.cache.redis not installed

Comments (6)

  1. sontek author

    Using python setup.py test the output looks like this:

    test_soft_invalidate_get_or_create_multi (tests.cache.test_region.RegionTest) ... ok
    test_soft_invalidate_requires_expire_time_get (tests.cache.test_region.RegionTest) ... ok
    test_soft_invalidate_requires_expire_time_get_multi (tests.cache.test_region.RegionTest) ... ok
    test_coerce_string_conf (tests.cache.test_utils.UtilsTest) ... ok
    
    ----------------------------------------------------------------------
    Ran 235 tests in 74.980s
    
    OK (skipped=13)
    

    which doesn't really help you discover tests that were skipped or anything. I also introduced test coverage by default which I think is very beneficial.

  2. Michael Bayer repo owner

    yeah the "legit" way, I should see if i can get sqlalchemy to do that way too b.c. i have a little bit of a hack for it at the moment (or if py.test could just fix this)