question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

1.4: pytest is failing

See original GitHub issue

Looks like it some issue with test suite

+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/autoflake-1.4
collected 119 items

test_autoflake.py ..........F..FF....FF.....F......................F.............FFF.F..............F.......F...FF.F......F.F............                            [100%]

================================================================================= FAILURES =================================================================================
________________________________________________________________________ UnitTests.test_filter_code ________________________________________________________________________

self = <test_autoflake.UnitTests testMethod=test_filter_code>

        def test_filter_code(self):
>           self.assertEqual(
                """\
    import os
    pass
    os.foo()
    """,
                ''.join(autoflake.filter_code("""\
    import os
    import re
    os.foo()
    """)))
E   AssertionError: 'import os\npass\nos.foo()\n' != 'import os\nimport re\nos.foo()\n'
E     import os
E   - pass
E   + import re
E     os.foo()

test_autoflake.py:157: AssertionError
____________________________________________________________ UnitTests.test_filter_code_multiline_from_imports _____________________________________________________________

self = <test_autoflake.UnitTests testMethod=test_filter_code_multiline_from_imports>

        def test_filter_code_multiline_from_imports(self):
>           self.assertEqual(
                r"""\
    import os
    pass
    from os.path import (
        join,
    )
    join('a', 'b')
    pass
    os.foo()
    from os.path import \
        isdir
    isdir('42')
    """,
                ''.join(autoflake.filter_code(r"""\
    import os
    import re
    from os.path import (
        exists,
        join,
    )
    join('a', 'b')
    from os.path import \
        abspath, basename, \
        commonpath
    os.foo()
    from os.path import \
        isfile \
        , isdir
    isdir('42')
    """)))
E   AssertionError: "\\\nimport os\npass\nfrom os.path import (\n    join,\n)[78 chars]')\n" != "\\\nimport os\nimport re\nfrom os.path import (\n    joi[83 chars]')\n"
E     \
E     import os
E   - pass
E   + import re
E     from os.path import (
E         join,
E     )
E     join('a', 'b')
E     pass
E     os.foo()
E     from os.path import \
E         isdir
E     isdir('42')

test_autoflake.py:443: AssertionError
_______________________________________________________________ UnitTests.test_filter_code_multiline_imports _______________________________________________________________

self = <test_autoflake.UnitTests testMethod=test_filter_code_multiline_imports>

        def test_filter_code_multiline_imports(self):
>           self.assertEqual(
                r"""\
    import os
    pass
    import os
    os.foo()
    """,
                ''.join(autoflake.filter_code(r"""\
    import os
    import re
    import os, \
        math, subprocess
    os.foo()
    """)))
E   AssertionError: '\\\nimport os\npass\nimport os\nos.foo()\n' != '\\\nimport os\nimport re\nimport os, \\\n    subprocess\nos.foo()\n'
E     \
E     import os
E   - pass
E   + import re
E   - import os
E   + import os, \
E   ?          +++
E   +     subprocess
E     os.foo()

test_autoflake.py:427: AssertionError
______________________________________________________ UnitTests.test_filter_code_should_ignore_non_standard_library _______________________________________________________

self = <test_autoflake.UnitTests testMethod=test_filter_code_should_ignore_non_standard_library>

        def test_filter_code_should_ignore_non_standard_library(self):
>           self.assertEqual(
                """\
    import os
    import my_own_module
    pass
    from my_package import another_module
    from my_package import subprocess
    from my_blah.my_blah_blah import blah
    os.foo()
    """,
                ''.join(autoflake.filter_code("""\
    import os
    import my_own_module
    import re
    from my_package import another_module
    from my_package import subprocess
    from my_blah.my_blah_blah import blah
    os.foo()
    """)))
E   AssertionError: 'impo[24 chars]ule\npass\nfrom my_package import another_modu[84 chars]()\n' != 'impo[24 chars]ule\nimport re\nfrom my_package import another[89 chars]()\n'
E     import os
E     import my_own_module
E   - pass
E   + import re
E     from my_package import another_module
E     from my_package import subprocess
E     from my_blah.my_blah_blah import blah
E     os.foo()

test_autoflake.py:491: AssertionError
___________________________________________________________ UnitTests.test_filter_code_should_ignore_semicolons ____________________________________________________________

self = <test_autoflake.UnitTests testMethod=test_filter_code_should_ignore_semicolons>

        def test_filter_code_should_ignore_semicolons(self):
>           self.assertEqual(
                r"""\
    import os
    pass
    import os; import math, subprocess
    os.foo()
    """,
                ''.join(autoflake.filter_code(r"""\
    import os
    import re
    import os; import math, subprocess
    os.foo()
    """)))
E   AssertionError: '\\\nimport os\npass\nimport os; import math, subprocess\nos.foo()\n' != '\\\nimport os\nimport re\nimport os; import math, subprocess\nos.foo()\n'
E     \
E     import os
E   - pass
E   + import re
E     import os; import math, subprocess
E     os.foo()

test_autoflake.py:476: AssertionError
_____________________________________________________________ UnitTests.test_filter_code_with_indented_import ______________________________________________________________

self = <test_autoflake.UnitTests testMethod=test_filter_code_with_indented_import>

        def test_filter_code_with_indented_import(self):
>           self.assertEqual(
                """\
    import os
    if True:
        pass
    os.foo()
    """,
                ''.join(autoflake.filter_code("""\
    import os
    if True:
        import re
    os.foo()
    """)))
E   AssertionError: 'import os\nif True:\n    pass\nos.foo()\n' != 'import os\nif True:\n    import re\nos.foo()\n'
E     import os
E     if True:
E   -     pass
E   +     import re
E     os.foo()

test_autoflake.py:170: AssertionError
_________________________________________________________________________ UnitTests.test_fix_code __________________________________________________________________________

self = <test_autoflake.UnitTests testMethod=test_fix_code>

        def test_fix_code(self):
>           self.assertEqual(
                """\
    import os
    import math
    from sys import version
    os.foo()
    math.pi
    x = version
    """,
                autoflake.fix_code("""\
    import os
    import re
    import abc, math, subprocess
    from sys import exit, version
    os.foo()
    math.pi
    x = version
    """))
E   AssertionError: 'import os\nimport math\nfrom sys import version\nos.foo()\n[18 chars]on\n' != 'import os\nimport re\nimport abc\nimport math\nimport subpr[60 chars]on\n'
E     import os
E   + import re
E   + import abc
E     import math
E   + import subprocess
E     from sys import version
E     os.foo()
E     math.pi
E     x = version

test_autoflake.py:573: AssertionError
_________________________________________________________________ UnitTests.test_fix_code_with_from_and_as _________________________________________________________________

self = <test_autoflake.UnitTests testMethod=test_fix_code_with_from_and_as>

        def test_fix_code_with_from_and_as(self):
>           self.assertEqual(
                """\
    from collections import namedtuple as xyz
    xyz
    """,
                autoflake.fix_code("""\
    from collections import defaultdict, namedtuple as xyz
    xyz
    """))
E   AssertionError: 'from collections import namedtuple as xyz\nxyz\n' != 'from collections import defaultdict, namedtuple as xyz\nxyz\n'
E   - from collections import namedtuple as xyz
E   + from collections import defaultdict, namedtuple as xyz
E   ?                        +++++++++++++
E     xyz

test_autoflake.py:593: AssertionError
_______________________________________________________ UnitTests.test_fix_code_with_from_and_as_and_escaped_newline _______________________________________________________

self = <test_autoflake.UnitTests testMethod=test_fix_code_with_from_and_as_and_escaped_newline>

        def test_fix_code_with_from_and_as_and_escaped_newline(self):
            """Make sure stuff after escaped newline is not lost."""
            result = autoflake.fix_code("""\
    from collections import defaultdict, namedtuple \\
        as xyz
    xyz
    """)
            # We currently leave lines with escaped newlines as is. But in the
            # future this we may parse them and remove unused import accordingly.
            # For now, we'll work around it here.
            result = re.sub(r' *\\\n *as ', ' as ', result)

>           self.assertEqual(
                """\
    from collections import namedtuple as xyz
    xyz
    """,
                autoflake.fix_code(result))
E               AssertionError: 'from collections import namedtuple as xyz\nxyz\n' != 'from collections import defaultdict, namedtuple as xyz\nxyz\n'
E               - from collections import namedtuple as xyz
E               + from collections import defaultdict, namedtuple as xyz
E               ?                        +++++++++++++
E                 xyz

test_autoflake.py:705: AssertionError
____________________________________________________________ UnitTests.test_fix_code_with_from_and_depth_module ____________________________________________________________

self = <test_autoflake.UnitTests testMethod=test_fix_code_with_from_and_depth_module>

        def test_fix_code_with_from_and_depth_module(self):
>           self.assertEqual(
                """\
    from distutils.version import StrictVersion
    StrictVersion('1.0.0')
    """,
                autoflake.fix_code("""\
    from distutils.version import LooseVersion, StrictVersion
    StrictVersion('1.0.0')
    """))
E   AssertionError: "from[17 chars]n import StrictVersion\nStrictVersion('1.0.0')\n" != "from[17 chars]n import LooseVersion, StrictVersion\nStrictVersion('1.0.0')\n"
E   - from distutils.version import StrictVersion
E   + from distutils.version import LooseVersion, StrictVersion
E   ?                              ++++++++++++++
E     StrictVersion('1.0.0')

test_autoflake.py:645: AssertionError
________________________________________________________________ UnitTests.test_fix_code_with_indented_from ________________________________________________________________

self = <test_autoflake.UnitTests testMethod=test_fix_code_with_indented_from>

        def test_fix_code_with_indented_from(self):
>           self.assertEqual(
                """\
    def z():
        from ctypes import POINTER, byref
        POINTER, byref
        """,
                autoflake.fix_code("""\
    def z():
        from ctypes import c_short, c_uint, c_int, c_long, pointer, POINTER, byref
        POINTER, byref
        """))
E       AssertionError: 'def [24 chars]port POINTER, byref\n    POINTER, byref\n    ' != 'def [24 chars]port c_short, c_uint, c_int, c_long, pointer, [36 chars]    '
E         def z():
E       -     from ctypes import POINTER, byref
E       +     from ctypes import c_short, c_uint, c_int, c_long, pointer, POINTER, byref
E             POINTER, byref

test_autoflake.py:666: AssertionError
__________________________________________________________________ UnitTests.test_standard_package_names ___________________________________________________________________

self = <test_autoflake.UnitTests testMethod=test_standard_package_names>

    def test_standard_package_names(self):
>       self.assertIn('os', list(autoflake.standard_package_names()))
E       AssertionError: 'os' not found in []

test_autoflake.py:77: AssertionError
__________________________________________________________ UnitTests.test_without_ignore_init_module_imports_flag __________________________________________________________

self = <test_autoflake.UnitTests testMethod=test_without_ignore_init_module_imports_flag>

    def test_without_ignore_init_module_imports_flag(self):
        # Need a temp directory in order to specify file name as __init__.py
        temp_directory = tempfile.mkdtemp(dir='.')
        temp_file = os.path.join(temp_directory, '__init__.py')
        try:
            with open(temp_file, 'w') as output:
                output.write('import re\n')

            p = subprocess.Popen(
                list(AUTOFLAKE_COMMAND) + [temp_file],
                stdout=subprocess.PIPE)
            result = p.communicate()[0].decode('utf-8')

>           self.assertIn('import re', result)
E           AssertionError: 'import re' not found in ''

test_autoflake.py:568: AssertionError
__________________________________________________________________________ SystemTests.test_diff ___________________________________________________________________________

self = <test_autoflake.SystemTests testMethod=test_diff>

        def test_diff(self):
            with temporary_file("""\
    import re
    import os
    import my_own_module
    x = 1
    """) as filename:
                output_file = io.StringIO()
                autoflake._main(argv=['my_fake_program', filename],
                                standard_out=output_file,
                                standard_error=None)
>               self.assertEqual("""\
    -import re
    -import os
     import my_own_module
     x = 1
    """, '\n'.join(output_file.getvalue().split('\n')[3:]))
E   AssertionError: '-import re\n-import os\n import my_own_module\n x = 1\n' != ' import re\n-import os\n import my_own_module\n x = 1\n'
E   - -import re
E   ? ^
E   +  import re
E   ? ^
E     -import os
E      import my_own_module
E      x = 1

test_autoflake.py:1328: AssertionError
_____________________________________________________________ SystemTests.test_diff_with_encoding_declaration ______________________________________________________________

self = <test_autoflake.SystemTests testMethod=test_diff_with_encoding_declaration>

        def test_diff_with_encoding_declaration(self):
            with temporary_file("""\
    # coding: iso-8859-1
    import re
    import os
    import my_own_module
    x = 1
    """) as filename:
                output_file = io.StringIO()
                autoflake._main(argv=['my_fake_program', filename],
                                standard_out=output_file,
                                standard_error=None)
>               self.assertEqual("""\
     # coding: iso-8859-1
    -import re
    -import os
     import my_own_module
     x = 1
    """, '\n'.join(output_file.getvalue().split('\n')[3:]))
E   AssertionError: ' # coding: iso-8859-1\n-import re\n-import os\n import my_own_module\n x = 1\n' != ' # coding: iso-8859-1\n import re\n-import os\n import my_own_module\n x = 1\n'
E      # coding: iso-8859-1
E   - -import re
E   ? ^
E   +  import re
E   ? ^
E     -import os
E      import my_own_module
E      x = 1

test_autoflake.py:1354: AssertionError
_______________________________________________________________________ SystemTests.test_end_to_end ________________________________________________________________________

self = <test_autoflake.SystemTests testMethod=test_end_to_end>

        def test_end_to_end(self):
            with temporary_file("""\
    import fake_fake, fake_foo, fake_bar, fake_zoo
    import re, os
    x = os.sep
    print(x)
    """) as filename:
                process = subprocess.Popen(AUTOFLAKE_COMMAND +
                                           ['--imports=fake_foo,fake_bar',
                                            filename],
                                           stdout=subprocess.PIPE)
>               self.assertEqual("""\
    -import fake_fake, fake_foo, fake_bar, fake_zoo
    -import re, os
    +import fake_fake
    +import fake_zoo
    +import os
     x = os.sep
     print(x)
    """, '\n'.join(process.communicate()[0].decode().split('\n')[3:]))
E   AssertionError: '-imp[84 chars]ort fake_zoo\n+import os\n x = os.sep\n print(x)\n' != '-imp[84 chars]ort fake_zoo\n+import os\n+import re\n x = os.sep\n print(x)\n'
E     -import fake_fake, fake_foo, fake_bar, fake_zoo
E     -import re, os
E     +import fake_fake
E     +import fake_zoo
E     +import os
E   + +import re
E      x = os.sep
E      print(x)

test_autoflake.py:1526: AssertionError
________________________________________________________________________ SystemTests.test_in_place _________________________________________________________________________

self = <test_autoflake.SystemTests testMethod=test_in_place>

        def test_in_place(self):
            with temporary_file("""\
    import foo
    x = foo
    import subprocess
    x()

    try:
        import os
    except ImportError:
        import os
    """) as filename:
                output_file = io.StringIO()
                autoflake._main(argv=['my_fake_program', '--in-place', filename],
                                standard_out=output_file,
                                standard_error=None)
                with open(filename) as f:
>                   self.assertEqual("""\
    import foo
    x = foo
    x()

    try:
        pass
    except ImportError:
        pass
    """, f.read())
E   AssertionError: 'import foo\nx = foo\nx()\n\ntry:\n    pass\nexcept ImportError:\n    pass\n' != 'import foo\nx = foo\nimport subprocess\nx()\n\ntry:\n    pass\[28 chars]ss\n'
E     import foo
E     x = foo
E   + import subprocess
E     x()
E
E     try:
E         pass
E     except ImportError:
E         pass

test_autoflake.py:1379: AssertionError
_____________________________________________________________ SystemTests.test_in_place_with_with_useless_pass _____________________________________________________________

self = <test_autoflake.SystemTests testMethod=test_in_place_with_with_useless_pass>

        def test_in_place_with_with_useless_pass(self):
            with temporary_file("""\
    import foo
    x = foo
    import subprocess
    x()

    try:
        pass
        import os
    except ImportError:
        pass
        import os
        import sys
    """) as filename:
                output_file = io.StringIO()
                autoflake._main(argv=['my_fake_program', '--in-place', filename],
                                standard_out=output_file,
                                standard_error=None)
                with open(filename) as f:
>                   self.assertEqual("""\
    import foo
    x = foo
    x()

    try:
        pass
    except ImportError:
        pass
    """, f.read())
E   AssertionError: 'import foo\nx = foo\nx()\n\ntry:\n    pass\nexcept ImportError:\n    pass\n' != 'import foo\nx = foo\nimport subprocess\nx()\n\ntry:\n    pass\[28 chars]ss\n'
E     import foo
E     x = foo
E   + import subprocess
E     x()
E
E     try:
E         pass
E     except ImportError:
E         pass

test_autoflake.py:1467: AssertionError
========================================================================= short test summary info ==========================================================================
FAILED test_autoflake.py::UnitTests::test_filter_code - AssertionError: 'import os\npass\nos.foo()\n' != 'import os\nimport re\nos.foo()\n'
FAILED test_autoflake.py::UnitTests::test_filter_code_multiline_from_imports - AssertionError: "\\\nimport os\npass\nfrom os.path import (\n    join,\n)[78 chars]')\n" !...
FAILED test_autoflake.py::UnitTests::test_filter_code_multiline_imports - AssertionError: '\\\nimport os\npass\nimport os\nos.foo()\n' != '\\\nimport os\nimport re\nimpo...
FAILED test_autoflake.py::UnitTests::test_filter_code_should_ignore_non_standard_library - AssertionError: 'impo[24 chars]ule\npass\nfrom my_package import another_modu[...
FAILED test_autoflake.py::UnitTests::test_filter_code_should_ignore_semicolons - AssertionError: '\\\nimport os\npass\nimport os; import math, subprocess\nos.foo()\n' !=...
FAILED test_autoflake.py::UnitTests::test_filter_code_with_indented_import - AssertionError: 'import os\nif True:\n    pass\nos.foo()\n' != 'import os\nif True:\n    imp...
FAILED test_autoflake.py::UnitTests::test_fix_code - AssertionError: 'import os\nimport math\nfrom sys import version\nos.foo()\n[18 chars]on\n' != 'import os\nimport re...
FAILED test_autoflake.py::UnitTests::test_fix_code_with_from_and_as - AssertionError: 'from collections import namedtuple as xyz\nxyz\n' != 'from collections import defa...
FAILED test_autoflake.py::UnitTests::test_fix_code_with_from_and_as_and_escaped_newline - AssertionError: 'from collections import namedtuple as xyz\nxyz\n' != 'from col...
FAILED test_autoflake.py::UnitTests::test_fix_code_with_from_and_depth_module - AssertionError: "from[17 chars]n import StrictVersion\nStrictVersion('1.0.0')\n" != "from...
FAILED test_autoflake.py::UnitTests::test_fix_code_with_indented_from - AssertionError: 'def [24 chars]port POINTER, byref\n    POINTER, byref\n    ' != 'def [24 chars]p...
FAILED test_autoflake.py::UnitTests::test_standard_package_names - AssertionError: 'os' not found in []
FAILED test_autoflake.py::UnitTests::test_without_ignore_init_module_imports_flag - AssertionError: 'import re' not found in ''
FAILED test_autoflake.py::SystemTests::test_diff - AssertionError: '-import re\n-import os\n import my_own_module\n x = 1\n' != ' import re\n-import os\n import my_own_m...
FAILED test_autoflake.py::SystemTests::test_diff_with_encoding_declaration - AssertionError: ' # coding: iso-8859-1\n-import re\n-import os\n import my_own_module\n x = ...
FAILED test_autoflake.py::SystemTests::test_end_to_end - AssertionError: '-imp[84 chars]ort fake_zoo\n+import os\n x = os.sep\n print(x)\n' != '-imp[84 chars]ort fake_zo...
FAILED test_autoflake.py::SystemTests::test_in_place - AssertionError: 'import foo\nx = foo\nx()\n\ntry:\n    pass\nexcept ImportError:\n    pass\n' != 'import foo\nx = ...
FAILED test_autoflake.py::SystemTests::test_in_place_with_with_useless_pass - AssertionError: 'import foo\nx = foo\nx()\n\ntry:\n    pass\nexcept ImportError:\n    pass\...
====================================================================== 18 failed, 101 passed in 4.12s ======================================================================

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
bnavigatorcommented, Aug 30, 2022

Sound plausible. The distutils.sysconfig module hijacked by setuptools 60+ reports the wrong platformdir. /usr/lib/ instead of /usr/lib64/ for 64bit architectures.

1reaction
bnavigatorcommented, Aug 28, 2022

The output is very similar, although not exactly the same, as OP used pytest and reported the issues back in January with autoflake 1.4.

Here is the output from a third slightly different setup than the docker reproducer. It is a bit closer to OP’s as we are like him using the tests to validate rpm package integrity.


[    5s] Executing(%check): /usr/bin/bash -e /var/tmp/rpm-tmp.Pbi82R
[    5s] + umask 022
[    5s] + cd /home/abuild/rpmbuild/BUILD
[    5s] + cd autoflake-1.5.1
[    5s] + export LANG=en_US.UTF-8
[    5s] + LANG=en_US.UTF-8
[    5s] + set +x
[    5s] Using alternative pyflakes-3.8 for pyflakes in ./build/flavorbin during Python 3.8 expansions.
[    5s] Using alternative autoflake-3.8 for autoflake in ./build/flavorbin during Python 3.8 expansions.
[    5s] Using alternative pyflakes-3.9 for pyflakes in ./build/flavorbin during Python 3.9 expansions.
[    5s] Using alternative autoflake-3.9 for autoflake in ./build/flavorbin during Python 3.9 expansions.
[    5s] Using alternative pyflakes-3.10 for pyflakes in ./build/flavorbin during Python 3.10 expansions.
[    5s] Using alternative autoflake-3.10 for autoflake in ./build/flavorbin during Python 3.10 expansions.
[    5s] + export PATH=/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/build/flavorbin:/usr/local/bin:/usr/bin:/bin
[    5s] + PATH=/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/build/flavorbin:/usr/local/bin:/usr/bin:/bin
[    5s] ++ '[' -f _current_flavor ']'
[    5s] ++ cat _current_flavor
[    5s] + last_flavor=python310
[    5s] + '[' -z python310 ']'
[    5s] + '[' python310 '!=' python38 ']'
[    5s] + '[' -d build ']'
[    5s] + mv build _build.python310
[    5s] + '[' -d _build.python38 ']'
[    5s] + mv _build.python38 build
[    5s] + echo python38
[    5s] + python_flavor=python38
[    5s] + PYTHONPATH=/home/abuild/rpmbuild/BUILDROOT/python-autoflake-1.5.1-0.x86_64/usr/lib/python3.8/site-packages
[    5s] + PYTHONDONTWRITEBYTECODE=1
[    5s] + python3.8 -m unittest -v test_autoflake
[    5s] test_common_path_instead_of_common_prefix (test_autoflake.ConfigFileTest)
[    5s] Using common prefix would result in a failure. ... ok
[    5s] test_common_path_nested_file_do_load (test_autoflake.ConfigFileTest) ... ok
[    5s] test_common_path_nested_file_do_not_load (test_autoflake.ConfigFileTest) ... ok
[    5s] test_continue_search_if_no_config_found (test_autoflake.ConfigFileTest) ... ok
[    5s] test_dont_load_false (test_autoflake.ConfigFileTest) ... ok
[    5s] test_list_value_comma_sep_string_pyproject_toml (test_autoflake.ConfigFileTest) ... ok
[    5s] test_list_value_pyproject_toml (test_autoflake.ConfigFileTest) ... ok
[    5s] test_list_value_setup_cfg (test_autoflake.ConfigFileTest) ... ok
[    5s] test_merge_with_cli_set_list_property (test_autoflake.ConfigFileTest) ... ok
[    5s] test_nested_file (test_autoflake.ConfigFileTest) ... ok
[    5s] test_no_config_file (test_autoflake.ConfigFileTest) ... ok
[    5s] test_non_bool_value_for_bool_property (test_autoflake.ConfigFileTest) ... 'expand-star-imports' in the config file should be a boolean
[    5s] ok
[    5s] test_non_bool_value_for_bool_property_in_setup_cfg (test_autoflake.ConfigFileTest) ... 'expand-star-imports' in the config file should be a boolean
[    5s] ok
[    5s] test_non_list_value_for_list_property (test_autoflake.ConfigFileTest) ... 'exclude' in the config file should be a comma separated string or list of strings
[    5s] ok
[    5s] test_non_nested_pyproject_toml_empty (test_autoflake.ConfigFileTest) ... ok
[    5s] test_non_nested_pyproject_toml_non_empty (test_autoflake.ConfigFileTest) ... ok
[    5s] test_non_nested_setup_cfg_empty (test_autoflake.ConfigFileTest) ... ok
[    5s] test_non_nested_setup_cfg_non_empty (test_autoflake.ConfigFileTest) ... ok
[    5s] test_stop_search_if_config_found (test_autoflake.ConfigFileTest) ... ok
[    5s] test_unknown_property (test_autoflake.ConfigFileTest) ... 'unknown_prop' is not a valid configuration option
[    5s] ok
[    5s] test_fix (test_autoflake.MultilineFromImportTests) ... ok
[    5s] test_fix_relative (test_autoflake.MultilineFromImportTests) ... ok
[    5s] test_fix_without_from (test_autoflake.MultilineFromImportTests) ... ok
[    5s] test_give_up (test_autoflake.MultilineFromImportTests) ... ok
[    5s] test_indentation (test_autoflake.MultilineFromImportTests) ... ok
[    5s] test_is_over (test_autoflake.MultilineFromImportTests) ... ok
[    5s] test_just_one_import_left (test_autoflake.MultilineFromImportTests) ... ok
[    5s] test_just_one_import_used (test_autoflake.MultilineFromImportTests) ... ok
[    5s] test_no_empty_imports (test_autoflake.MultilineFromImportTests) ... ok
[    5s] test_without_remove_all (test_autoflake.MultilineFromImportTests) ... ok
[    5s] test_check_correct_file (test_autoflake.SystemTests) ... ok
[    5s] test_check_correct_file_with_quiet (test_autoflake.SystemTests) ... ok
[    5s] test_check_useless_pass (test_autoflake.SystemTests) ... ok
[    5s] test_check_with_empty_file (test_autoflake.SystemTests) ... ok
[    5s] test_diff (test_autoflake.SystemTests) ... FAIL
[    5s] test_diff_with_encoding_declaration (test_autoflake.SystemTests) ... FAIL
[    5s] test_diff_with_nonexistent_file (test_autoflake.SystemTests) ... ok
[    5s] test_end_to_end (test_autoflake.SystemTests) ... FAIL
[    5s] test_end_to_end_from_stdin (test_autoflake.SystemTests) ... ok
[    6s] test_end_to_end_from_stdin_with_in_place (test_autoflake.SystemTests) ... ok
[    6s] test_end_to_end_with_error (test_autoflake.SystemTests) ... ok
[    6s] test_end_to_end_with_remove_all_unused_imports (test_autoflake.SystemTests) ... ok
[    6s] test_end_to_end_with_remove_duplicate_keys_and_other_errors (test_autoflake.SystemTests) ... ok
[    6s] test_end_to_end_with_remove_duplicate_keys_multiple_lines (test_autoflake.SystemTests) ... ok
[    6s] test_end_to_end_with_remove_duplicate_keys_tuple (test_autoflake.SystemTests) ... ok
[    6s] test_ignore_hidden_directories (test_autoflake.SystemTests) ... ok
[    6s] test_in_place (test_autoflake.SystemTests) ... FAIL
[    6s] test_in_place_and_stdout (test_autoflake.SystemTests) ... usage: autoflake [-h] [-c] [-r] [-j n] [--exclude globs] [--imports IMPORTS]
[    6s]                  [--expand-star-imports] [--remove-all-unused-imports]
[    6s]                  [--ignore-init-module-imports] [--remove-duplicate-keys]
[    6s]                  [--remove-unused-variables] [--version] [--quiet] [-v]
[    6s]                  [--stdin-display-name STDIN_DISPLAY_NAME] [-i | -s]
[    6s]                  files [files ...]
[    6s] autoflake: error: argument -s/--stdout: not allowed with argument -i/--in-place
[    6s] ok
[    6s] test_in_place_with_empty_file (test_autoflake.SystemTests) ... ok
[    6s] test_in_place_with_with_useless_pass (test_autoflake.SystemTests) ... FAIL
[    6s] test_redundant_options (test_autoflake.SystemTests) ... ok
[    6s] test_with_missing_file (test_autoflake.SystemTests) ... ok
[    6s] test_break_up_import (test_autoflake.UnitTests) ... ok
[    6s] test_break_up_import_should_do_nothing_on_no_line_ending (test_autoflake.UnitTests) ... ok
[    6s] test_break_up_import_with_indentation (test_autoflake.UnitTests) ... ok
[    6s] test_check (test_autoflake.UnitTests) ... ok
[    6s] test_check_with_bad_syntax (test_autoflake.UnitTests) ... ok
[    6s] test_check_with_unicode (test_autoflake.UnitTests) ... ok
[    6s] test_detect_encoding_with_bad_encoding (test_autoflake.UnitTests) ... ok
[    7s] test_exclude (test_autoflake.UnitTests) ... ok
[    7s] test_extract_package_name (test_autoflake.UnitTests) ... ok
[    7s] test_extract_package_name_should_ignore_doctest_for_now (test_autoflake.UnitTests) ... ok
[    7s] test_filter_code (test_autoflake.UnitTests) ... FAIL
[    7s] test_filter_code_expand_star_imports (test_autoflake.UnitTests) ... ok
[    7s] test_filter_code_ignore_multiple_star_import (test_autoflake.UnitTests) ... ok
[    7s] test_filter_code_multiline_from_imports (test_autoflake.UnitTests) ... FAIL
[    7s] test_filter_code_multiline_imports (test_autoflake.UnitTests) ... FAIL
[    7s] test_filter_code_should_avoid_escaped_newlines (test_autoflake.UnitTests) ... ok
[    7s] test_filter_code_should_avoid_inline_except (test_autoflake.UnitTests) ... ok
[    7s] test_filter_code_should_ignore_docstring (test_autoflake.UnitTests) ... ok
[    7s] test_filter_code_should_ignore_imports_with_inline_comment (test_autoflake.UnitTests) ... ok
[    7s] test_filter_code_should_ignore_non_standard_library (test_autoflake.UnitTests) ... FAIL
[    7s] test_filter_code_should_ignore_semicolons (test_autoflake.UnitTests) ... FAIL
[    7s] test_filter_code_should_ignore_unsafe_imports (test_autoflake.UnitTests) ... ok
[    7s] test_filter_code_should_respect_noqa (test_autoflake.UnitTests) ... ok
[    7s] test_filter_code_with_additional_imports (test_autoflake.UnitTests) ... ok
[    7s] test_filter_code_with_ambiguous_from (test_autoflake.UnitTests) ... ok
[    7s] test_filter_code_with_from (test_autoflake.UnitTests) ... ok
[    7s] test_filter_code_with_indented_import (test_autoflake.UnitTests) ... FAIL
[    7s] test_filter_code_with_not_from (test_autoflake.UnitTests) ... ok
[    7s] test_filter_code_with_remove_all_unused_imports (test_autoflake.UnitTests) ... ok
[    7s] test_filter_code_with_special_re_symbols_in_key (test_autoflake.UnitTests) ... ok
[    7s] test_filter_code_with_used_from (test_autoflake.UnitTests) ... ok
[    7s] test_filter_from_import_no_remove (test_autoflake.UnitTests) ... ok
[    7s] test_filter_from_import_remove_all (test_autoflake.UnitTests) ... ok
[    7s] test_filter_from_import_remove_module (test_autoflake.UnitTests) ... ok
[    7s] test_filter_star_import (test_autoflake.UnitTests) ... ok
[    7s] test_filter_unused_variable (test_autoflake.UnitTests) ... ok
[    7s] test_filter_unused_variable_should_ignore_multiline (test_autoflake.UnitTests) ... ok
[    7s] test_filter_unused_variable_should_multiple_assignments (test_autoflake.UnitTests) ... ok
[    7s] test_filter_unused_variable_with_basic_data_structures (test_autoflake.UnitTests) ... ok
[    7s] test_filter_unused_variable_with_exception (test_autoflake.UnitTests) ... ok
[    7s] test_filter_unused_variable_with_literal_or_name (test_autoflake.UnitTests) ... ok
[    7s] test_filter_useless_pass (test_autoflake.UnitTests) ... ok
[    7s] test_filter_useless_pass_leading_pass (test_autoflake.UnitTests) ... ok
[    7s] test_filter_useless_pass_leading_pass_with_number (test_autoflake.UnitTests) ... ok
[    7s] test_filter_useless_pass_leading_pass_with_string (test_autoflake.UnitTests) ... ok
[    7s] test_filter_useless_pass_more_complex (test_autoflake.UnitTests) ... ok
[    7s] test_filter_useless_pass_with_syntax_error (test_autoflake.UnitTests) ... ok
[    7s] test_filter_useless_pass_with_try (test_autoflake.UnitTests) ... ok
[    7s] test_find_files (test_autoflake.UnitTests) ... ok
[    7s] test_fix_code (test_autoflake.UnitTests) ... FAIL
[    7s] test_fix_code_should_handle_pyflakes_recursion_error_gracefully (test_autoflake.UnitTests) ... ok
[    7s] test_fix_code_should_ignore_complex_case_of_duplicate_key (test_autoflake.UnitTests)
[    7s] We only handle simple cases. ... ok
[    7s] test_fix_code_should_ignore_complex_case_of_duplicate_key_comma (test_autoflake.UnitTests)
[    7s] We only handle simple cases. ... ok
[    7s] test_fix_code_should_ignore_complex_case_of_duplicate_key_partially (test_autoflake.UnitTests)
[    7s] We only handle simple cases. ... ok
[    7s] test_fix_code_should_ignore_duplicate_key_with_comments (test_autoflake.UnitTests)
[    7s] We only handle simple cases. ... ok
[    7s] test_fix_code_should_ignore_duplicate_key_with_multiline_key (test_autoflake.UnitTests)
[    7s] We only handle simple cases. ... ok
[    7s] test_fix_code_should_ignore_duplicate_key_with_no_comma (test_autoflake.UnitTests)
[    7s] We don't want to delete the line and leave a lone comma. ... ok
[    7s] test_fix_code_should_ignore_more_cases_of_duplicate_key (test_autoflake.UnitTests)
[    7s] We only handle simple cases. ... ok
[    7s] test_fix_code_with_comma_on_right (test_autoflake.UnitTests)
[    7s] pyflakes does not handle nonlocal correctly. ... ok
[    7s] test_fix_code_with_duplicate_key (test_autoflake.UnitTests) ... ok
[    7s] test_fix_code_with_duplicate_key_longer (test_autoflake.UnitTests) ... ok
[    7s] test_fix_code_with_duplicate_key_with_many_braces (test_autoflake.UnitTests) ... ok
[    7s] test_fix_code_with_empty_string (test_autoflake.UnitTests) ... ok
[    7s] test_fix_code_with_from_and_as (test_autoflake.UnitTests) ... FAIL
[    7s] test_fix_code_with_from_and_as_and_escaped_newline (test_autoflake.UnitTests)
[    7s] Make sure stuff after escaped newline is not lost. ... FAIL
[    7s] test_fix_code_with_from_and_depth_module (test_autoflake.UnitTests) ... FAIL
[    7s] test_fix_code_with_from_with_and_without_remove_all (test_autoflake.UnitTests) ... ok
[    7s] test_fix_code_with_indented_from (test_autoflake.UnitTests) ... FAIL
[    7s] test_fix_code_with_unused_variables (test_autoflake.UnitTests) ... ok
[    7s] test_fix_code_with_unused_variables_should_skip_multiple (test_autoflake.UnitTests) ... ok
[    7s] test_fix_code_with_unused_variables_should_skip_nonlocal (test_autoflake.UnitTests)
[    7s] pyflakes does not handle nonlocal correctly. ... ok
[    7s] test_get_diff_text (test_autoflake.UnitTests) ... ok
[    7s] test_get_diff_text_without_newline (test_autoflake.UnitTests) ... ok
[    7s] test_get_indentation (test_autoflake.UnitTests) ... ok
[    7s] test_get_line_ending (test_autoflake.UnitTests) ... ok
[    7s] test_imports (test_autoflake.UnitTests) ... ok
[    7s] test_is_exclude_file (test_autoflake.UnitTests) ... ok
[    7s] test_is_literal_or_name (test_autoflake.UnitTests) ... ok
[    7s] test_is_python_file (test_autoflake.UnitTests) ... ok
[    7s] test_match_file (test_autoflake.UnitTests) ... ok
[    7s] test_multiline_import (test_autoflake.UnitTests) ... ok
[    7s] test_multiline_statement (test_autoflake.UnitTests) ... ok
[    7s] test_standard_package_names (test_autoflake.UnitTests) ... FAIL
[    7s] test_unused_import_line_numbers (test_autoflake.UnitTests) ... ok
[    7s] test_unused_import_line_numbers_with_dot (test_autoflake.UnitTests) ... ok
[    7s] test_unused_import_line_numbers_with_from (test_autoflake.UnitTests) ... ok
[    7s] test_useless_pass_line_numbers (test_autoflake.UnitTests) ... ok
[    7s] test_useless_pass_line_numbers_with_escaped_newline (test_autoflake.UnitTests) ... ok
[    7s] test_useless_pass_line_numbers_with_more_complex (test_autoflake.UnitTests) ... ok
[    7s] test_with_ignore_init_module_imports_flag (test_autoflake.UnitTests) ... ok
[    7s] test_without_ignore_init_module_imports_flag (test_autoflake.UnitTests) ... FAIL
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_diff (test_autoflake.SystemTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 1647, in test_diff
[    7s]     self.assertEqual(
[    7s] AssertionError: '-import re\n-import os\n import my_own_module\n x = 1\n' != ' import re\n-import os\n import my_own_module\n x = 1\n'
[    7s] - -import re
[    7s] ? ^
[    7s] +  import re
[    7s] ? ^
[    7s]   -import os
[    7s]    import my_own_module
[    7s]    x = 1
[    7s] 
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_diff_with_encoding_declaration (test_autoflake.SystemTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 1679, in test_diff_with_encoding_declaration
[    7s]     self.assertEqual(
[    7s] AssertionError: ' # coding: iso-8859-1\n-import re\n-import os\n import my_own_module\n x = 1\n' != ' # coding: iso-8859-1\n import re\n-import os\n import my_own_module\n x = 1\n'
[    7s]    # coding: iso-8859-1
[    7s] - -import re
[    7s] ? ^
[    7s] +  import re
[    7s] ? ^
[    7s]   -import os
[    7s]    import my_own_module
[    7s]    x = 1
[    7s] 
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_end_to_end (test_autoflake.SystemTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 1917, in test_end_to_end
[    7s]     self.assertEqual(
[    7s] AssertionError: '-imp[84 chars]ort fake_zoo\n+import os\n x = os.sep\n print(x)\n' != '-imp[84 chars]ort fake_zoo\n+import os\n+import re\n x = os.sep\n print(x)\n'
[    7s]   -import fake_fake, fake_foo, fake_bar, fake_zoo
[    7s]   -import re, os
[    7s]   +import fake_fake
[    7s]   +import fake_zoo
[    7s]   +import os
[    7s] + +import re
[    7s]    x = os.sep
[    7s]    print(x)
[    7s] 
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_in_place (test_autoflake.SystemTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 1708, in test_in_place
[    7s]     self.assertEqual(
[    7s] AssertionError: 'import foo\nx = foo\nx()\n\ntry:\n    pass\nexcept ImportError:\n    pass\n' != 'import foo\nx = foo\nimport subprocess\nx()\n\ntry:\n    pass\[28 chars]ss\n'
[    7s]   import foo
[    7s]   x = foo
[    7s] + import subprocess
[    7s]   x()
[    7s]   
[    7s]   try:
[    7s]       pass
[    7s]   except ImportError:
[    7s]       pass
[    7s] 
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_in_place_with_with_useless_pass (test_autoflake.SystemTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 1827, in test_in_place_with_with_useless_pass
[    7s]     self.assertEqual(
[    7s] AssertionError: 'import foo\nx = foo\nx()\n\ntry:\n    pass\nexcept ImportError:\n    pass\n' != 'import foo\nx = foo\nimport subprocess\nx()\n\ntry:\n    pass\[28 chars]ss\n'
[    7s]   import foo
[    7s]   x = foo
[    7s] + import subprocess
[    7s]   x()
[    7s]   
[    7s]   try:
[    7s]       pass
[    7s]   except ImportError:
[    7s]       pass
[    7s] 
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_filter_code (test_autoflake.UnitTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 201, in test_filter_code
[    7s]     self.assertEqual(
[    7s] AssertionError: 'import os\npass\nos.foo()\n' != 'import os\nimport re\nos.foo()\n'
[    7s]   import os
[    7s] - pass
[    7s] + import re
[    7s]   os.foo()
[    7s] 
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_filter_code_multiline_from_imports (test_autoflake.UnitTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 584, in test_filter_code_multiline_from_imports
[    7s]     self.assertEqual(
[    7s] AssertionError: "\\\nimport os\npass\nfrom os.path import (\n    join,\n)[78 chars]')\n" != "\\\nimport os\nimport re\nfrom os.path import (\n    joi[83 chars]')\n"
[    7s]   \
[    7s]   import os
[    7s] - pass
[    7s] + import re
[    7s]   from os.path import (
[    7s]       join,
[    7s]   )
[    7s]   join('a', 'b')
[    7s]   pass
[    7s]   os.foo()
[    7s]   from os.path import \
[    7s]       isdir
[    7s]   isdir('42')
[    7s] 
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_filter_code_multiline_imports (test_autoflake.UnitTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 565, in test_filter_code_multiline_imports
[    7s]     self.assertEqual(
[    7s] AssertionError: '\\\nimport os\npass\nimport os\nos.foo()\n' != '\\\nimport os\nimport re\nimport os, \\\n    subprocess\nos.foo()\n'
[    7s]   \
[    7s]   import os
[    7s] - pass
[    7s] + import re
[    7s] - import os
[    7s] + import os, \
[    7s] ?          +++
[    7s] +     subprocess
[    7s]   os.foo()
[    7s] 
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_filter_code_should_ignore_non_standard_library (test_autoflake.UnitTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 638, in test_filter_code_should_ignore_non_standard_library
[    7s]     self.assertEqual(
[    7s] AssertionError: 'impo[24 chars]ule\npass\nfrom my_package import another_modu[84 chars]()\n' != 'impo[24 chars]ule\nimport re\nfrom my_package import another[89 chars]()\n'
[    7s]   import os
[    7s]   import my_own_module
[    7s] - pass
[    7s] + import re
[    7s]   from my_package import another_module
[    7s]   from my_package import subprocess
[    7s]   from my_blah.my_blah_blah import blah
[    7s]   os.foo()
[    7s] 
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_filter_code_should_ignore_semicolons (test_autoflake.UnitTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 620, in test_filter_code_should_ignore_semicolons
[    7s]     self.assertEqual(
[    7s] AssertionError: '\\\nimport os\npass\nimport os; import math, subprocess\nos.foo()\n' != '\\\nimport os\nimport re\nimport os; import math, subprocess\nos.foo()\n'
[    7s]   \
[    7s]   import os
[    7s] - pass
[    7s] + import re
[    7s]   import os; import math, subprocess
[    7s]   os.foo()
[    7s] 
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_filter_code_with_indented_import (test_autoflake.UnitTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 217, in test_filter_code_with_indented_import
[    7s]     self.assertEqual(
[    7s] AssertionError: 'import os\nif True:\n    pass\nos.foo()\n' != 'import os\nif True:\n    import re\nos.foo()\n'
[    7s]   import os
[    7s]   if True:
[    7s] -     pass
[    7s] +     import re
[    7s]   os.foo()
[    7s] 
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_fix_code (test_autoflake.UnitTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 728, in test_fix_code
[    7s]     self.assertEqual(
[    7s] AssertionError: 'import os\nimport math\nfrom sys import version\nos.foo()\n[18 chars]on\n' != 'import os\nimport re\nimport abc\nimport math\nimport subpr[60 chars]on\n'
[    7s]   import os
[    7s] + import re
[    7s] + import abc
[    7s]   import math
[    7s] + import subprocess
[    7s]   from sys import version
[    7s]   os.foo()
[    7s]   math.pi
[    7s]   x = version
[    7s] 
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_fix_code_with_from_and_as (test_autoflake.UnitTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 749, in test_fix_code_with_from_and_as
[    7s]     self.assertEqual(
[    7s] AssertionError: 'from collections import namedtuple as xyz\nxyz\n' != 'from collections import defaultdict, namedtuple as xyz\nxyz\n'
[    7s] - from collections import namedtuple as xyz
[    7s] + from collections import defaultdict, namedtuple as xyz
[    7s] ?                        +++++++++++++
[    7s]   xyz
[    7s] 
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_fix_code_with_from_and_as_and_escaped_newline (test_autoflake.UnitTests)
[    7s] Make sure stuff after escaped newline is not lost.
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 872, in test_fix_code_with_from_and_as_and_escaped_newline
[    7s]     self.assertEqual(
[    7s] AssertionError: 'from collections import namedtuple as xyz\nxyz\n' != 'from collections import defaultdict, namedtuple as xyz\nxyz\n'
[    7s] - from collections import namedtuple as xyz
[    7s] + from collections import defaultdict, namedtuple as xyz
[    7s] ?                        +++++++++++++
[    7s]   xyz
[    7s] 
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_fix_code_with_from_and_depth_module (test_autoflake.UnitTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 807, in test_fix_code_with_from_and_depth_module
[    7s]     self.assertEqual(
[    7s] AssertionError: "from[17 chars]n import StrictVersion\nStrictVersion('1.0.0')\n" != "from[17 chars]n import LooseVersion, StrictVersion\nStrictVersion('1.0.0')\n"
[    7s] - from distutils.version import StrictVersion
[    7s] + from distutils.version import LooseVersion, StrictVersion
[    7s] ?                              ++++++++++++++
[    7s]   StrictVersion('1.0.0')
[    7s] 
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_fix_code_with_indented_from (test_autoflake.UnitTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 830, in test_fix_code_with_indented_from
[    7s]     self.assertEqual(
[    7s] AssertionError: 'def [24 chars]port POINTER, byref\n    POINTER, byref\n    ' != 'def [24 chars]port c_short, c_uint, c_int, c_long, pointer, [36 chars]    '
[    7s]   def z():
[    7s] -     from ctypes import POINTER, byref
[    7s] +     from ctypes import c_short, c_uint, c_int, c_long, pointer, POINTER, byref
[    7s]       POINTER, byref
[    7s]       
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_standard_package_names (test_autoflake.UnitTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 92, in test_standard_package_names
[    7s]     self.assertIn('os', list(autoflake.standard_package_names()))
[    7s] AssertionError: 'os' not found in []
[    7s] 
[    7s] ======================================================================
[    7s] FAIL: test_without_ignore_init_module_imports_flag (test_autoflake.UnitTests)
[    7s] ----------------------------------------------------------------------
[    7s] Traceback (most recent call last):
[    7s]   File "/home/abuild/rpmbuild/BUILD/autoflake-1.5.1/test_autoflake.py", line 723, in test_without_ignore_init_module_imports_flag
[    7s]     self.assertIn('import re', result)
[    7s] AssertionError: 'import re' not found in ''
[    7s] 
[    7s] ----------------------------------------------------------------------
[    7s] Ran 143 tests in 1.786s
[    7s] 
[    7s] FAILED (failures=18)
[    7s] error: Bad exit status from /var/tmp/rpm-tmp.Pbi82R (%check)

Read more comments on GitHub >

github_iconTop Results From Across the Web

1.4.2: pytest is failing · Issue #94 - GitHub
I think I know why it failed. I have installed randomly pytest extension which is causing that each time pytest units are executed...
Read more >
python - Pytest - error vs fail - Stack Overflow
For pytest, any uncaught exception thrown in a test function is a failure, including but not limited to assertion errors.
Read more >
Changelog — pytest documentation
After 6.2.0, these types began failing, because they inherited neither from standard Python number hierarchy nor from numpy.ndarray .
Read more >
pytest delayed assert / multiple failure plugin, iteration 1
pytest delayed assert / multiple failure plugin, iteration 1 ... platform darwin -- Python 2.7.9 -- py-1.4.26 -- pytest-2.6.4 collected 2 ...
Read more >
pandas code style guide — pandas 1.4.0 documentation
Do not use this method. It has the same behavior as pytest.skip , namely it immediately stops the test and does not check...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found