GeezerVison is showing github.com — tesr, #519: FIX failures in py2.6 due to missing `assertRaisesRegexp` · gitpython-developers/GitPython@c785a03
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .travis.yml +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -32,7 +32,8 @@ script: | 32 | 32 | - ulimit -n 96 | 33 | 33 | - ulimit -n | 34 | 34 | - nosetests -v --with-coverage | 35 | | - - flake8 | 36 | | - - cd doc && make html | | 35 | + - if [ "$TRAVIS_PYTHON_VERSION" != '2.6' ]; then flake8 fi | | 36 | + - if [ "$TRAVIS_PYTHON_VERSION" != '2.6' ]; then cd doc && make html fi | | 37 | + - | 37 | 38 | after_success: | 38 | 39 | - coveralls |
Collapse file Copy file name to clipboardExpand all lines: git/test/test_git.py +7-1Lines changed: 7 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -234,12 +234,18 @@ def counter_stdout(line): | 234 | 234 | def counter_stderr(line): | 235 | 235 | count[2] += 1 | 236 | 236 |
| | 237 | + from subprocess import STARTUPINFO, STARTF_USESHOWWINDOW, SW_HIDE | | 238 | + si = STARTUPINFO() | | 239 | + si.dwFlags = STARTF_USESHOWWINDOW | | 240 | + si.wShowWindow = SW_HIDE | 237 | 241 | proc = subprocess.Popen([sys.executable, fixture_path('cat_file.py'), str(fixture_path('issue-301_stderr'))], | 238 | 242 | stdin=None, | 239 | 243 | stdout=subprocess.PIPE, | 240 | 244 | stderr=subprocess.PIPE, | 241 | 245 | shell=False, | 242 | | - creationflags=Git.CREATE_NO_WINDOW if sys.platform == 'win32' else 0, | | 246 | + universal_newlines=True, | | 247 | +# creationflags=Git.CREATE_NO_WINDOW if sys.platform == 'win32' else 0, | | 248 | +# startupinfo=si | 243 | 249 | ) | 244 | 250 |
| 245 | 251 | handle_process_output(proc, counter_stdout, counter_stderr, lambda proc: proc.wait()) | |
Collapse file Copy file name to clipboardExpand all lines: git/test/test_index.py +5-2Lines changed: 5 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -135,7 +135,7 @@ def _cmp_tree_index(self, tree, index): | 135 | 135 | raise AssertionError("CMP Failed: Missing entries in index: %s, missing in tree: %s" % | 136 | 136 | (bset - iset, iset - bset)) | 137 | 137 | # END assertion message | 138 | | - | | 138 | + | 139 | 139 | @with_rw_repo('0.1.6') | 140 | 140 | def test_index_lock_handling(self, rw_repo): | 141 | 141 | def add_bad_blob(): | @@ -157,6 +157,9 @@ def add_bad_blob(): | 157 | 157 |
| 158 | 158 | @with_rw_repo('0.1.6') | 159 | 159 | def test_index_file_from_tree(self, rw_repo): | | 160 | + if sys.version_info < (2, 7): | | 161 | + ## Skipped, not `assertRaisesRegexp` in py2.6 | | 162 | + return | 160 | 163 | common_ancestor_sha = "5117c9c8a4d3af19a9958677e45cda9269de1541" | 161 | 164 | cur_sha = "4b43ca7ff72d5f535134241e7c797ddc9c7a3573" | 162 | 165 | other_sha = "39f85c4358b7346fee22169da9cad93901ea9eb9" | @@ -576,7 +579,7 @@ def mixed_iterator(): | 576 | 579 | if sys.platform != "win32": | 577 | 580 | for target in ('/etc/nonexisting', '/etc/passwd', '/etc'): | 578 | 581 | basename = "my_real_symlink" | 579 | | - | | 582 | + | 580 | 583 | link_file = os.path.join(rw_repo.working_tree_dir, basename) | 581 | 584 | os.symlink(target, link_file) | 582 | 585 | entries = index.reset(new_commit).add([link_file], fprogress=self._fprogress_add) | |
Collapse file Copy file name to clipboardExpand all lines: git/test/test_repo.py +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -106,7 +106,7 @@ def test_tree_from_revision(self): | 106 | 106 |
| 107 | 107 | # try from invalid revision that does not exist | 108 | 108 | self.failUnlessRaises(BadName, self.rorepo.tree, 'hello world') | 109 | | - | | 109 | + | 110 | 110 | def test_pickleable(self): | 111 | 111 | pickle.loads(pickle.dumps(self.rorepo)) | 112 | 112 |
| @@ -314,6 +314,9 @@ def test_archive(self): | 314 | 314 |
| 315 | 315 | @patch.object(Git, '_call_process') | 316 | 316 | def test_should_display_blame_information(self, git): | | 317 | + if sys.version_info < (2, 7): | | 318 | + ## Skipped, not `assertRaisesRegexp` in py2.6 | | 319 | + return | 317 | 320 | git.return_value = fixture('blame') | 318 | 321 | b = self.rorepo.blame('master', 'lib/git.py') | 319 | 322 | assert_equal(13, len(b)) | |
|