diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index b09d63ced..184974cf2 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -28,5 +28,5 @@ pytest-rerunfailures==2.0.0 pytest-travis-fold==1.2.0 pytest-xvfb==0.2.0 six==1.10.0 -vulture==0.8.1 +vulture==0.9 Werkzeug==0.11.10 diff --git a/misc/requirements/requirements-vulture.txt b/misc/requirements/requirements-vulture.txt index 47a2c6741..e3e35ba70 100644 --- a/misc/requirements/requirements-vulture.txt +++ b/misc/requirements/requirements-vulture.txt @@ -1,3 +1,3 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -vulture==0.8.1 +vulture==0.9 diff --git a/scripts/dev/run_vulture.py b/scripts/dev/run_vulture.py index bc09717e6..b894377cf 100755 --- a/scripts/dev/run_vulture.py +++ b/scripts/dev/run_vulture.py @@ -77,14 +77,6 @@ def whitelist_generator(): for func in qutescheme.HANDLERS.values(): yield 'qutebrowser.browser.webkit.network.qutescheme.' + func.__name__ - # Globals - # https://bitbucket.org/jendrikseipp/vulture/issues/10/ - yield 'qutebrowser.misc.utilcmds.pyeval_output' - yield 'utils.use_color' - yield 'qutebrowser.browser.webkit.mhtml.last_used_directory' - yield 'qutebrowser.utils.utils.fake_clipboard' - yield 'qutebrowser.utils.utils.log_clipboard' - # Other false-positives yield ('qutebrowser.completion.models.sortfilter.CompletionFilterModel().' 'lessThan') @@ -127,9 +119,9 @@ def report(items): properties which get used for the items. """ output = [] - for item in sorted(items, key=lambda e: (e.file.lower(), e.lineno)): - relpath = os.path.relpath(item.file) - path = relpath if not relpath.startswith('..') else item.file + for item in sorted(items, key=lambda e: (e.filename.lower(), e.lineno)): + relpath = os.path.relpath(item.filename) + path = relpath if not relpath.startswith('..') else item.filename output.append("{}:{}: Unused {} '{}'".format(path, item.lineno, item.typ, item)) return output diff --git a/tests/unit/scripts/test_run_vulture.py b/tests/unit/scripts/test_run_vulture.py index f2427c11c..91f7a0744 100644 --- a/tests/unit/scripts/test_run_vulture.py +++ b/tests/unit/scripts/test_run_vulture.py @@ -138,26 +138,3 @@ def test_unused_method_camelcase(vultdir): Foo() """) assert not vultdir.run() - - -@pytest.mark.xfail( - True, reason="https://bitbucket.org/jendrikseipp/vulture/issues/10/") -def test_globals_bug(vultdir): - """Vulture has a bug where it detects globals as unused. - - When this test starts XPASSing, we know it's been fixed. - """ - vultdir.makepyfile(foo=""" - import bar - - bar.attr = True - bar.blub() - """) - vultdir.makepyfile(bar=""" - attr = False - - def blub(): - if attr: - print("Hey!") - """) - assert not vultdir.run()