diff --git a/klaus/repo.py b/klaus/repo.py index 97d5b19899d29254a6b7aee71fb3630b4c61bf8d..3ab506bdb0322582932746840bcf3bd7078484e0 100644 --- a/klaus/repo.py +++ b/klaus/repo.py @@ -96,9 +96,9 @@ class FancyRepo(dulwich.repo.Repo): def get_tag_and_branch_shas(self): """Return a list of SHAs of all tags and branches.""" - tag_shas = self.refs.as_dict('refs/tags/').values() - branch_shas = self.refs.as_dict('refs/heads/').values() - return tag_shas + branch_shas + tag_shas = self.refs.as_dict(b'refs/tags/').values() + branch_shas = self.refs.as_dict(b'refs/heads/').values() + return set(tag_shas) | set(branch_shas) def history(self, commit, path=None, max_commits=None, skip=0): """Return a list of all commits that affected `path`, starting at branch diff --git a/test_requirements.txt b/test_requirements.txt index 64420ba81b035e7cc07b23d1b836d6f68f0734f7..9634e7ca979f5d5f9a177418ef999e79f2200b20 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -1,4 +1,4 @@ pytest requests -python-ctags; python_version < '3' # not supported on Python 3 +python-ctags3 mock; python_version < '3' diff --git a/tests/test_make_app.py b/tests/test_make_app.py index 58da9bd43c53f32f1f55adfd93e1ad14edaea95c..b1fb28142bbc05963ba50d31a1fe294a992afbb3 100644 --- a/tests/test_make_app.py +++ b/tests/test_make_app.py @@ -13,9 +13,6 @@ import requests.auth from .utils import * -xfail_py3 = pytest.mark.xfail(sys.version_info[0] >= 3, reason="not supported on Python 3") - - def test_htdigest_file_without_smarthttp_or_require_browser_auth(): with pytest.raises(ValueError): klaus.make_app([], None, htdigest_file=object()) @@ -84,14 +81,14 @@ test_ctags_disabled = options_test( {}, {'ctags_tags_and_branches': False, 'ctags_all': False} ) -test_ctags_tags_and_branches = xfail_py3(options_test( +test_ctags_tags_and_branches = options_test( {'ctags_policy': 'tags-and-branches'}, {'ctags_tags_and_branches': True, 'ctags_all': False} -)) -test_ctags_all = xfail_py3(options_test( +) +test_ctags_all = options_test( {'ctags_policy': 'ALL'}, {'ctags_tags_and_branches': True, 'ctags_all': True} -)) +) # Reach @@ -155,6 +152,7 @@ def ctags_all(): def _ctags_enabled(ref, filename): response = requests.get(UNAUTH_TEST_REPO_URL + "blob/%s/%s" % (ref, filename)) + assert response.status_code == 200, response.text href = '<a href="/%sblob/%s/%s#L-1">' % (TEST_REPO_URL, ref, filename) return href in response.text