Skip to content

Commit

Permalink
Disable black formatting for expected strings
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Jan 8, 2022
1 parent b350568 commit f1c0d2a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 28 deletions.
25 changes: 8 additions & 17 deletions tests/installation/test_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,25 +251,16 @@ def test_execute_works_with_ansi_output(
)
env._run.assert_called_once()

# fmt: off
expected = [
"\x1b[39;1mPackage operations\x1b[39;22m: \x1b[34m1\x1b[39m install,"
" \x1b[34m0\x1b[39m updates, \x1b[34m0\x1b[39m removals",
"\x1b[34;1m•\x1b[39;22m \x1b[39mInstalling"
" \x1b[39m\x1b[36mpytest\x1b[39m\x1b[39m"
" (\x1b[39m\x1b[39;1m3.5.2\x1b[39;22m\x1b[39m)\x1b[39m:"
" \x1b[34mPending...\x1b[39m",
"\x1b[34;1m•\x1b[39;22m \x1b[39mInstalling"
" \x1b[39m\x1b[36mpytest\x1b[39m\x1b[39m"
" (\x1b[39m\x1b[39;1m3.5.2\x1b[39;22m\x1b[39m)\x1b[39m:"
" \x1b[34mDownloading...\x1b[39m",
"\x1b[34;1m•\x1b[39;22m \x1b[39mInstalling"
" \x1b[39m\x1b[36mpytest\x1b[39m\x1b[39m"
" (\x1b[39m\x1b[39;1m3.5.2\x1b[39;22m\x1b[39m)\x1b[39m:"
" \x1b[34mInstalling...\x1b[39m",
"\x1b[32;1m•\x1b[39;22m \x1b[39mInstalling"
" \x1b[39m\x1b[36mpytest\x1b[39m\x1b[39m"
" (\x1b[39m\x1b[32m3.5.2\x1b[39m\x1b[39m)\x1b[39m", # finished
"\x1b[39;1mPackage operations\x1b[39;22m: \x1b[34m1\x1b[39m install, \x1b[34m0\x1b[39m updates, \x1b[34m0\x1b[39m removals", # noqa: E501
"\x1b[34;1m•\x1b[39;22m \x1b[39mInstalling \x1b[39m\x1b[36mpytest\x1b[39m\x1b[39m (\x1b[39m\x1b[39;1m3.5.2\x1b[39;22m\x1b[39m)\x1b[39m: \x1b[34mPending...\x1b[39m", # noqa: E501
"\x1b[34;1m•\x1b[39;22m \x1b[39mInstalling \x1b[39m\x1b[36mpytest\x1b[39m\x1b[39m (\x1b[39m\x1b[39;1m3.5.2\x1b[39;22m\x1b[39m)\x1b[39m: \x1b[34mDownloading...\x1b[39m", # noqa: E501
"\x1b[34;1m•\x1b[39;22m \x1b[39mInstalling \x1b[39m\x1b[36mpytest\x1b[39m\x1b[39m (\x1b[39m\x1b[39;1m3.5.2\x1b[39;22m\x1b[39m)\x1b[39m: \x1b[34mInstalling...\x1b[39m", # noqa: E501
"\x1b[32;1m•\x1b[39;22m \x1b[39mInstalling \x1b[39m\x1b[36mpytest\x1b[39m\x1b[39m (\x1b[39m\x1b[32m3.5.2\x1b[39m\x1b[39m)\x1b[39m", # finished # noqa: E501
]
# fmt: on

output = io_decorated.fetch_output()
# hint: use print(repr(output)) if you need to debug this

Expand Down
18 changes: 7 additions & 11 deletions tests/utils/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def test_parse_requires():
isort@ git+git://github.com/timothycrosley/isort.git@e63ae06ec7d70b06df9e528357650281a3d3ec22#egg=isort
""" # noqa: E501
result = parse_requires(requires)
# fmt: off
expected = [
"jsonschema>=2.6.0.0,<3.0.0.0",
"lockfile>=0.12.0.0,<0.13.0.0",
Expand All @@ -56,18 +57,13 @@ def test_parse_requires():
"msgpack-python>=0.5.0.0,<0.6.0.0",
"pyparsing>=2.2.0.0,<3.0.0.0",
"requests-toolbelt>=0.8.0.0,<0.9.0.0",
'typing>=3.6.0.0,<4.0.0.0 ; (python_version >= "2.7.0.0" and python_version <'
' "2.8.0.0") or (python_version >= "3.4.0.0" and python_version < "3.5.0.0")',
'virtualenv>=15.2.0.0,<16.0.0.0 ; python_version >= "2.7.0.0" and'
' python_version < "2.8.0.0"',
'pathlib2>=2.3.0.0,<3.0.0.0 ; python_version >= "2.7.0.0" and python_version <'
' "2.8.0.0"',
'zipfile36>=0.1.0.0,<0.2.0.0 ; python_version >= "3.4.0.0" and python_version <'
' "3.6.0.0"',
"isort@"
" git+git://github.com/timothycrosley/isort.git@e63ae06ec7d70b06df9e528357650281a3d3ec22#egg=isort" # noqa: E501
' ; extra == "dev"',
'typing>=3.6.0.0,<4.0.0.0 ; (python_version >= "2.7.0.0" and python_version < "2.8.0.0") or (python_version >= "3.4.0.0" and python_version < "3.5.0.0")', # noqa: E501
'virtualenv>=15.2.0.0,<16.0.0.0 ; python_version >= "2.7.0.0" and python_version < "2.8.0.0"', # noqa: E501
'pathlib2>=2.3.0.0,<3.0.0.0 ; python_version >= "2.7.0.0" and python_version < "2.8.0.0"', # noqa: E501
'zipfile36>=0.1.0.0,<0.2.0.0 ; python_version >= "3.4.0.0" and python_version < "3.6.0.0"', # noqa: E501
'isort@ git+git://github.com/timothycrosley/isort.git@e63ae06ec7d70b06df9e528357650281a3d3ec22#egg=isort ; extra == "dev"', # noqa: E501
]
# fmt: on
assert result == expected


Expand Down

0 comments on commit f1c0d2a

Please sign in to comment.