]>
git.madduck.net Git - etc/vim.git/blobdiff - tests/test_black.py
madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@ git. madduck. net .
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged .
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
#!/usr/bin/env python3
from functools import partial
from io import StringIO
#!/usr/bin/env python3
from functools import partial
from io import StringIO
from pathlib import Path
import sys
from typing import Any, List, Tuple
from pathlib import Path
import sys
from typing import Any, List, Tuple
maxDiff = None
def assertFormatEqual(self, expected: str, actual: str) -> None:
maxDiff = None
def assertFormatEqual(self, expected: str, actual: str) -> None:
+ if actual != expected and not os.environ.get('SKIP_AST_PRINT') :
bdv: black.DebugVisitor[Any]
black.out('Expected tree:', fg='green')
try:
bdv: black.DebugVisitor[Any]
black.out('Expected tree:', fg='green')
try:
try:
sys.stdin, sys.stdout = StringIO(source), StringIO()
sys.stdin.name = '<stdin>'
try:
sys.stdin, sys.stdout = StringIO(source), StringIO()
sys.stdin.name = '<stdin>'
- black.format_stdin_to_stdout(line_length=ll, fast=True)
+ black.format_stdin_to_stdout(line_length=ll, fast=True, write_back=True )
sys.stdout.seek(0)
actual = sys.stdout.read()
finally:
sys.stdout.seek(0)
actual = sys.stdout.read()
finally: