Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bfce49f

Browse filesBrowse files
committed
rewrote test-string to have a chance to make flake8 happy.
That way, flake won't have to completely ignore issues it might have in other portions of this file.
1 parent b825dc7 commit bfce49f
Copy full SHA for bfce49f

File tree

Expand file treeCollapse file tree

1 file changed

+9
-10
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-10
lines changed
Open diff view settings
Collapse file

‎git/test/test_config.py‎

Copy file name to clipboardExpand all lines: git/test/test_config.py
+9-10Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
#
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
6-
# The test test_multi_line_config requires whitespace (especially tabs) to remain
7-
# flake8: noqa
86

97
from git.test.lib import (
108
TestCase,
@@ -78,14 +76,15 @@ def test_read_write(self):
7876
def test_multi_line_config(self):
7977
file_obj = self._to_memcache(fixture_path("git_config_with_comments"))
8078
config = GitConfigParser(file_obj, read_only=False)
81-
ev = r"""ruby -e '
82-
system %(git), %(merge-file), %(--marker-size=%L), %(%A), %(%O), %(%B)
83-
b = File.read(%(%A))
84-
b.sub!(/^<+ .*\nActiveRecord::Schema\.define.:version => (\d+). do\n=+\nActiveRecord::Schema\.define.:version => (\d+). do\n>+ .*/) do
85-
%(ActiveRecord::Schema.define(:version => #{[$1, $2].max}) do)
86-
end
87-
File.open(%(%A), %(w)) {|f| f.write(b)}
88-
exit 1 if b.include?(%(<)*%L)'"""
79+
ev = "ruby -e '\n"
80+
ev += " system %(git), %(merge-file), %(--marker-size=%L), %(%A), %(%O), %(%B)\n"
81+
ev += " b = File.read(%(%A))\n"
82+
ev += " b.sub!(/^<+ .*\\nActiveRecord::Schema\\.define.:version => (\\d+). do\\n=+\\nActiveRecord::Schema\\."
83+
ev += "define.:version => (\\d+). do\\n>+ .*/) do\n"
84+
ev += " %(ActiveRecord::Schema.define(:version => #{[$1, $2].max}) do)\n"
85+
ev += " end\n"
86+
ev += " File.open(%(%A), %(w)) {|f| f.write(b)}\n"
87+
ev += " exit 1 if b.include?(%(<)*%L)'"
8988
assert_equal(config.get('merge "railsschema"', 'driver'), ev)
9089
assert_equal(config.get('alias', 'lg'),
9190
"log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset'"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.