jacebrowning / yorm

Automatic object-YAML mapping for Python.
https://yorm.readthedocs.io
MIT License
27 stars 6 forks source link

Hide internals in pytest stack traces #132

Closed jacebrowning closed 7 years ago

jacebrowning commented 7 years ago
config = <gitman.models.config.Config object at 0x10b5c7b38>

    def it_should_fail_on_invalid_repositories(config):
        os.system("mkdir deps && touch deps/gitman_1")

        with pytest.raises(InvalidRepository):
>           gitman.lock()

/Users/Browning/Programs/gitman/tests/test_api.py:336:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/Users/Browning/Programs/gitman/gitman/commands.py:18: in wrapped
    result = func(*args, **kwargs)
/Users/Browning/Programs/gitman/gitman/commands.py:155: in lock
    count = config.lock_depenendencies(*names, obey_existing=False)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gitman.models.config.Config object at 0x10b6bbf98>, args = ('lock_depenendencies',), kwargs = {}
mapper = <yorm.mapper.Mapper object at 0x10b6bbba8>

    @functools.wraps(method)
    def wrapped(self, *args, **kwargs):
        """Decorated method."""
        if not _private_call(method, args):
            mapper = common.get_mapper(self)
            if mapper and mapper.modified:
                log.debug("Loading before call: %s", method.__name__)
                mapper.load()
                if mapper.auto_save_after_load:
                    mapper.save()
                    mapper.modified = False

>       return method(self, *args, **kwargs)
E       AttributeError: 'Config' object has no attribute 'lock_depenendencies'

/Users/Browning/Programs/gitman/env/lib/python3.5/site-packages/YORM-1.1-py3.5.egg/yorm/bases/mappable.py:30: AttributeError

should look like:

config = <gitman.models.config.Config object at 0x10cd91d30>

    def it_should_fail_on_invalid_repositories(config):
        os.system("mkdir deps && touch deps/gitman_1")

        with pytest.raises(InvalidRepository):
>           gitman.lock()

/Users/Browning/Programs/gitman/tests/test_api.py:336:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/Users/Browning/Programs/gitman/gitman/commands.py:18: in wrapped
    result = func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

root = '/private/tmp/gitman-shared', names = (), count = None
config = <gitman.models.config.Config object at 0x10cd95668>

    @restore_cwd
    def lock(*names, root=None):
        """Lock current dependency versions for a project.

        Optional arguments:

        - `*names`: optional list of dependency directory names to filter on
        - `root`: specifies the path to the root working tree

        """
        log.info("Locking dependencies...")
        count = None

        root = _find_root(root)
        config = load_config(root)

        if config:
            common.show()
            common.show("Locking dependencies...", color='message', log=False)
            common.show()
>           count = config.lock_depenendencies(*names, obey_existing=False)
E           AttributeError: 'Config' object has no attribute 'lock_depenendencies'

/Users/Browning/Programs/gitman/gitman/commands.py:155: AttributeError