klen / pylama

Code audit tool for python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tests/test_config.py::test_config fails when extracted to versioned directory (e.g. from GH archive)

mgorny opened this issue · comments

It seems that the tests/test_config.py::test_config test relies on the unpack directory being named exactly pylama. This isn't true e.g. when using GitHub archives:

$ wget https://github.com/klen/pylama/archive/8.3.2.tar.gz
[...]
$ tar -xf 8.3.2.tar.gz  # creates pylama-8.3.2
$ cd pylama-8.3.2
$ tox -e py310
[...]
============================================================== FAILURES ===============================================================
_____________________________________________________________ test_config _____________________________________________________________

parse_options = <function parse_options at 0x7f85116ffb50>

    def test_config(parse_options):
        from pylama.config import get_config
    
        config = get_config()
        assert config
    
        options = parse_options()
        assert options
        assert options.skip
        assert options.max_line_length
        assert not options.verbose
        assert options.paths
>       assert options.paths[0].endswith('pylama')
E       AssertionError: assert False
E        +  where False = <built-in method endswith of str object at 0x7f85115f0300>('pylama')
E        +    where <built-in method endswith of str object at 0x7f85115f0300> = '/tmp/pylama-8.3.2'.endswith

tests/test_config.py:13: AssertionError

Thank you for the report. I've changed the test.