import functools
import sys
import nose
from preparation.resources.Resource import trunks_registered, applied_modifiers, resource_by_trunk

__author__ = 'moskupols'

_multiprocess_shared_ = True

_all_trunks = set(trunks_registered())
_trunk_filter = _all_trunks


def trunk_parametrized(trunks=set(trunks_registered())):
    def decorate(tester):
        @functools.wraps(tester)
        def generate_tests(*args):
            for t in _trunk_filter & trunks:
                yield (tester, t) + args
        return generate_tests

    return decorate


@functools.lru_cache()
def asset_cache(trunk):
    return tuple(applied_modifiers(resource_by_trunk(trunk)()))


def main(args=None):
    global _trunk_filter

    if args is None:
        args = sys.argv

    _trunk_filter = _all_trunks & set(args)
    if len(_trunk_filter) == 0:
        _trunk_filter = _all_trunks

    args = [arg for arg in args if arg not in _trunk_filter]
    nose.main(argv=args)

@@ -754,39 +754,102 @@
 s.argv%0A%0A    
-_trunk_filter =
+include = _all_trunks & set(args)%0A    exclude_percented = set('%25' + t for t in
  _all_trunks
@@ -840,32 +840,33 @@
 t in _all_trunks
+)
  & set(args)%0A   
@@ -870,71 +870,150 @@
     
-if len(_trunk_filter) == 0:%0A        _trunk_filter = _all_trunks
+exclude = set(e%5B1:%5D for e in exclude_percented)%0A%0A    if len(include) == 0:%0A        include = _all_trunks%0A    _trunk_filter = include - exclude
 %0A%0A  
@@ -1056,29 +1056,43 @@
  not in 
-_trunk_filter
+include %7C exclude_percented
 %5D%0A    no

Add ability to exclude trunks by passing % before it