Skip to content

Commit

Permalink
Remove redundant quotes while patching 'find_project_root'
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivansh-007 committed Nov 2, 2021
1 parent 4b92fd1 commit 7a5bac6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_black.py
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,7 @@ def test_gitignore_used_as_default(self) -> None:
src = [base / "b/"]
assert_collected_sources(src, expected, extend_exclude=r"/exclude/")

@patch("black.find_project_root", lambda *args: (THIS_DIR.resolve(), "None"))
@patch("black.find_project_root", lambda *args: (THIS_DIR.resolve(), None))
def test_exclude_for_issue_1572(self) -> None:
# Exclude shouldn't touch files that were explicitly given to Black through the
# CLI. Exclude is supposed to only apply to the recursive discovery of files.
Expand Down Expand Up @@ -1965,13 +1965,13 @@ def test_symlink_out_of_root_directory(self) -> None:
child.is_symlink.assert_called()
assert child.is_symlink.call_count == 2

@patch("black.find_project_root", lambda *args: (THIS_DIR.resolve(), "None"))
@patch("black.find_project_root", lambda *args: (THIS_DIR.resolve(), None))
def test_get_sources_with_stdin(self) -> None:
src = ["-"]
expected = ["-"]
assert_collected_sources(src, expected, include="", exclude=r"/exclude/|a\.py")

@patch("black.find_project_root", lambda *args: (THIS_DIR.resolve(), "None"))
@patch("black.find_project_root", lambda *args: (THIS_DIR.resolve(), None))
def test_get_sources_with_stdin_filename(self) -> None:
src = ["-"]
stdin_filename = str(THIS_DIR / "data/collections.py")
Expand All @@ -1983,7 +1983,7 @@ def test_get_sources_with_stdin_filename(self) -> None:
stdin_filename=stdin_filename,
)

@patch("black.find_project_root", lambda *args: (THIS_DIR.resolve(), "None"))
@patch("black.find_project_root", lambda *args: (THIS_DIR.resolve(), None))
def test_get_sources_with_stdin_filename_and_exclude(self) -> None:
# Exclude shouldn't exclude stdin_filename since it is mimicking the
# file being passed directly. This is the same as
Expand All @@ -1999,7 +1999,7 @@ def test_get_sources_with_stdin_filename_and_exclude(self) -> None:
stdin_filename=stdin_filename,
)

@patch("black.find_project_root", lambda *args: (THIS_DIR.resolve(), "None"))
@patch("black.find_project_root", lambda *args: (THIS_DIR.resolve(), None))
def test_get_sources_with_stdin_filename_and_extend_exclude(self) -> None:
# Extend exclude shouldn't exclude stdin_filename since it is mimicking the
# file being passed directly. This is the same as
Expand All @@ -2015,7 +2015,7 @@ def test_get_sources_with_stdin_filename_and_extend_exclude(self) -> None:
stdin_filename=stdin_filename,
)

@patch("black.find_project_root", lambda *args: (THIS_DIR.resolve(), "None"))
@patch("black.find_project_root", lambda *args: (THIS_DIR.resolve(), None))
def test_get_sources_with_stdin_filename_and_force_exclude(self) -> None:
# Force exclude should exclude the file when passing it through
# stdin_filename
Expand Down

0 comments on commit 7a5bac6

Please sign in to comment.