WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 092027b

Browse files
committed
Fix merge
1 parent f4d6a50 commit 092027b

File tree

2 files changed

+2
-28
lines changed

2 files changed

+2
-28
lines changed

tests/test_black.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,7 +2042,6 @@ def test_symlink_out_of_root_directory(self) -> None:
20422042
path.iterdir.return_value = [child]
20432043
child.resolve.return_value = Path("/a/b/c")
20442044
child.as_posix.return_value = "/a/b/c"
2045-
child.is_symlink.return_value = True
20462045
try:
20472046
list(
20482047
black.gen_python_files(
@@ -2062,31 +2061,6 @@ def test_symlink_out_of_root_directory(self) -> None:
20622061
pytest.fail(f"`get_python_files_in_dir()` failed: {ve}")
20632062
path.iterdir.assert_called_once()
20642063
child.resolve.assert_called_once()
2065-
child.is_symlink.assert_called_once()
2066-
# `child` should behave like a strange file which resolved path is clearly
2067-
# outside of the `root` directory.
2068-
child.is_symlink.return_value = False
2069-
with pytest.raises(ValueError):
2070-
list(
2071-
black.gen_python_files(
2072-
path.iterdir(),
2073-
root,
2074-
include,
2075-
exclude,
2076-
None,
2077-
None,
2078-
report,
2079-
gitignore,
2080-
verbose=False,
2081-
quiet=False,
2082-
)
2083-
)
2084-
path.iterdir.assert_called()
2085-
assert path.iterdir.call_count == 2
2086-
child.resolve.assert_called()
2087-
assert child.resolve.call_count == 2
2088-
child.is_symlink.assert_called()
2089-
assert child.is_symlink.call_count == 2
20902064

20912065
@patch("black.find_project_root", lambda *args: (THIS_DIR.resolve(), None))
20922066
def test_get_sources_with_stdin(self) -> None:

tests/test_ipynb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
import pytest
1717
from black import Mode
1818
from _pytest.monkeypatch import MonkeyPatch
19-
from tests.util import DATA_DIR
19+
from tests.util import DATA_DIR, TOML_CONFIG_DIR
2020

2121
pytestmark = pytest.mark.jupyter
2222
pytest.importorskip("IPython", reason="IPython is an optional dependency")
2323
pytest.importorskip("tokenize_rt", reason="tokenize-rt is an optional dependency")
2424

2525
JUPYTER_MODE = Mode(is_ipynb=True)
2626

27-
EMPTY_CONFIG = DATA_DIR / "empty_pyproject.toml"
27+
EMPTY_CONFIG = TOML_CONFIG_DIR / "empty_pyproject.toml"
2828

2929
runner = CliRunner()
3030

0 commit comments

Comments
 (0)