-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into black
- Loading branch information
Showing
5 changed files
with
29 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import os | ||
import pathlib | ||
import shutil | ||
import subprocess | ||
|
@@ -22,14 +21,15 @@ | |
|
||
|
||
@pytest.mark.skipif(shutil.which('git') is None, reason="need git to make merge conflicts") | ||
@pytest.mark.skipif( | ||
os.getenv('GITHUB_ACTIONS') == 'true', reason="somehow doesn't work in gh actions" | ||
) | ||
def test_merge_conflict_string(tmp_path, monkeypatch, capfd): | ||
monkeypatch.chdir(tmp_path) | ||
file_content = 'before\nhello\nafter\n' | ||
|
||
subprocess.run(['git', 'init']) | ||
# No --global, only affects test repo | ||
subprocess.run(['git', 'config', 'user.name', 'foo']) | ||
subprocess.run(['git', 'config', 'user.email', '[email protected]']) | ||
|
||
pathlib.Path('foo.txt').write_text(file_content) | ||
subprocess.run(['git', 'add', 'foo.txt']) | ||
subprocess.run(['git', 'commit', '-m', 'create foo.txt']) | ||
|
@@ -41,7 +41,7 @@ def test_merge_conflict_string(tmp_path, monkeypatch, capfd): | |
subprocess.run(['git', 'commit', '--all', '-m', 'hello my friend']) | ||
subprocess.run(['git', 'merge', 'other_branch']) | ||
assert pathlib.Path('foo.txt').read_text() == merge_conflict_string | ||
capfd.readouterr() # prevents unnecessary prints from git | ||
capfd.readouterr() # hide unnecessary prints from git | ||
|
||
|
||
def test_find_merge_conflicts(filetab): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters