From 02b447f939bc42375123859d7df937bc7a02db60 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Wed, 2 May 2018 14:08:55 -0500 Subject: [PATCH 01/14] Use gitpython for tags --- readthedocs/rtd_tests/tests/test_backend.py | 24 ----------- readthedocs/vcs_support/backends/git.py | 46 +++------------------ 2 files changed, 6 insertions(+), 64 deletions(-) diff --git a/readthedocs/rtd_tests/tests/test_backend.py b/readthedocs/rtd_tests/tests/test_backend.py index 827f9f39d6a..bc75fed425b 100644 --- a/readthedocs/rtd_tests/tests/test_backend.py +++ b/readthedocs/rtd_tests/tests/test_backend.py @@ -57,30 +57,6 @@ def test_git_checkout(self): repo.checkout() self.assertTrue(exists(repo.working_dir)) - def test_parse_git_tags(self): - data = """\ - 3b32886c8d3cb815df3793b3937b2e91d0fb00f1 refs/tags/2.0.0 - bd533a768ff661991a689d3758fcfe72f455435d refs/tags/2.0.1 - c0288a17899b2c6818f74e3a90b77e2a1779f96a refs/tags/2.0.2 - a63a2de628a3ce89034b7d1a5ca5e8159534eef0 refs/tags/2.1.0.beta2 - c7fc3d16ed9dc0b19f0d27583ca661a64562d21e refs/tags/2.1.0.rc1 - edc0a2d02a0cc8eae8b67a3a275f65cd126c05b1 refs/tags/2.1.0.rc2 - 274a5a8c988a804e40da098f59ec6c8f0378fe34 refs/tags/release/foobar - """ - expected_tags = [ - ('3b32886c8d3cb815df3793b3937b2e91d0fb00f1', '2.0.0'), - ('bd533a768ff661991a689d3758fcfe72f455435d', '2.0.1'), - ('c0288a17899b2c6818f74e3a90b77e2a1779f96a', '2.0.2'), - ('a63a2de628a3ce89034b7d1a5ca5e8159534eef0', '2.1.0.beta2'), - ('c7fc3d16ed9dc0b19f0d27583ca661a64562d21e', '2.1.0.rc1'), - ('edc0a2d02a0cc8eae8b67a3a275f65cd126c05b1', '2.1.0.rc2'), - ('274a5a8c988a804e40da098f59ec6c8f0378fe34', 'release/foobar'), - ] - - given_ids = [(x.identifier, x.verbose_name) for x in - self.project.vcs_repo().parse_tags(data)] - self.assertEqual(expected_tags, given_ids) - def test_check_for_submodules(self): repo = self.project.vcs_repo() diff --git a/readthedocs/vcs_support/backends/git.py b/readthedocs/vcs_support/backends/git.py index 5b021ad066a..9248b72da6d 100644 --- a/readthedocs/vcs_support/backends/git.py +++ b/readthedocs/vcs_support/backends/git.py @@ -122,46 +122,12 @@ def clone(self): @property def tags(self): - retcode, stdout, _ = self.run( - 'git', - 'show-ref', - '--tags', - record_as_success=True, - ) - # error (or no tags found) - if retcode != 0: - return [] - return self.parse_tags(stdout) - - def parse_tags(self, data): - """ - Parses output of show-ref --tags, eg: - - 3b32886c8d3cb815df3793b3937b2e91d0fb00f1 refs/tags/2.0.0 - bd533a768ff661991a689d3758fcfe72f455435d refs/tags/2.0.1 - c0288a17899b2c6818f74e3a90b77e2a1779f96a refs/tags/2.0.2 - a63a2de628a3ce89034b7d1a5ca5e8159534eef0 refs/tags/2.1.0.beta2 - c7fc3d16ed9dc0b19f0d27583ca661a64562d21e refs/tags/2.1.0.rc1 - edc0a2d02a0cc8eae8b67a3a275f65cd126c05b1 refs/tags/2.1.0.rc2 - - Into VCSTag objects with the tag name as verbose_name and the commit - hash as identifier. - """ - # parse the lines into a list of tuples (commit-hash, tag ref name) - # StringIO below is expecting Unicode data, so ensure that it gets it. - if not isinstance(data, str): - data = str(data) - delimiter = str(' ').encode('utf-8') if PY2 else str(' ') - raw_tags = csv.reader(StringIO(data), delimiter=delimiter) - vcs_tags = [] - for row in raw_tags: - row = [f for f in row if f != ''] - if row == []: - continue - commit_hash, name = row - clean_name = name.replace('refs/tags/', '') - vcs_tags.append(VCSVersion(self, commit_hash, clean_name)) - return vcs_tags + repo = git.Repo(self.working_dir) + versions = [ + VCSVersion(self, str(tag.commit), str(tag)) + for tag in repo.tags + ] + return versions @property def branches(self): From a096a03cb1a5efb1e9e949e70735ed74a8172355 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Mon, 7 May 2018 16:46:30 -0500 Subject: [PATCH 02/14] Move log to check_output --- readthedocs/rtd_tests/utils.py | 50 ++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/readthedocs/rtd_tests/utils.py b/readthedocs/rtd_tests/utils.py index 3651aa72df9..420cc70746c 100644 --- a/readthedocs/rtd_tests/utils.py +++ b/readthedocs/rtd_tests/utils.py @@ -22,6 +22,7 @@ def check_output(l, env=()): else: output = subprocess.Popen(l, stdout=subprocess.PIPE, env=env).communicate()[0] + log.info(output) return output @@ -36,59 +37,60 @@ def make_test_git(): chdir(directory) # Initialize and configure - # TODO: move the ``log.info`` call inside the ``check_output``` - log.info(check_output(['git', 'init'] + [directory], env=env)) - log.info(check_output( + check_output(['git', 'init'] + [directory], env=env) + check_output( ['git', 'config', 'user.email', 'dev@readthedocs.org'], env=env - )) - log.info(check_output( + ) + check_output( ['git', 'config', 'user.name', 'Read the Docs'], env=env - )) + ) # Set up the actual repository - log.info(check_output(['git', 'add', '.'], env=env)) - log.info(check_output(['git', 'commit', '-m"init"'], env=env)) + check_output(['git', 'add', '.'], env=env) + check_output(['git', 'commit', '-m"init"'], env=env) # Add fake repo as submodule. We need to fake this here because local path # URL are not allowed and using a real URL will require Internet to clone # the repo - log.info(check_output(['git', 'checkout', '-b', 'submodule', 'master'], env=env)) + check_output(['git', 'checkout', '-b', 'submodule', 'master'], env=env) # https://stackoverflow.com/a/37378302/2187091 mkdir(pjoin(directory, 'foobar')) gitmodules_path = pjoin(directory, '.gitmodules') with open(gitmodules_path, 'w') as fh: fh.write('''[submodule "foobar"]\n\tpath = foobar\n\turl = https://foobar.com/git\n''') - log.info(check_output( + check_output( [ 'git', 'update-index', '--add', '--cacheinfo', '160000', '233febf4846d7a0aeb95b6c28962e06e21d13688', 'foobar', ], env=env, - )) - log.info(check_output(['git', 'add', '.'], env=env)) - log.info(check_output(['git', 'commit', '-m"Add submodule"'], env=env)) + ) + check_output(['git', 'add', '.'], env=env) + check_output(['git', 'commit', '-m"Add submodule"'], env=env) # Add a relative submodule URL in the relativesubmodule branch - log.info(check_output(['git', 'checkout', '-b', 'relativesubmodule', 'master'], env=env)) - log.info(check_output( + check_output(['git', 'checkout', '-b', 'relativesubmodule', 'master'], env=env) + check_output( ['git', 'submodule', 'add', '-b', 'master', './', 'relativesubmodule'], env=env - )) - log.info(check_output(['git', 'add', '.'], env=env)) - log.info(check_output(['git', 'commit', '-m"Add relative submodule"'], env=env)) + ) + check_output(['git', 'add', '.'], env=env) + check_output(['git', 'commit', '-m"Add relative submodule"'], env=env) # Add an invalid submodule URL in the invalidsubmodule branch - log.info(check_output(['git', 'checkout', '-b', 'invalidsubmodule', 'master'], env=env)) - log.info(check_output( + check_output(['git', 'checkout', '-b', 'invalidsubmodule', 'master'], env=env) + check_output( ['git', 'submodule', 'add', '-b', 'master', './', 'invalidsubmodule'], env=env, - )) - log.info(check_output(['git', 'add', '.'], env=env)) - log.info(check_output(['git', 'commit', '-m"Add invalid submodule"'], env=env)) + ) + check_output(['git', 'add', '.'], env=env) + check_output(['git', 'commit', '-m"Add invalid submodule"'], env=env) # Checkout to master branch again - log.info(check_output(['git', 'checkout', 'master'], env=env)) + check_output(['git', 'checkout', 'master'], env=env) + + # Create some tags chdir(path) return directory From ef619e7c66188eeff54a5a87b0158b919ee3e472 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Mon, 7 May 2018 17:47:16 -0500 Subject: [PATCH 03/14] Add tests --- readthedocs/rtd_tests/tests/test_backend.py | 15 ++++++++++++++- readthedocs/rtd_tests/utils.py | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/readthedocs/rtd_tests/tests/test_backend.py b/readthedocs/rtd_tests/tests/test_backend.py index bc75fed425b..f13b1d00095 100644 --- a/readthedocs/rtd_tests/tests/test_backend.py +++ b/readthedocs/rtd_tests/tests/test_backend.py @@ -9,7 +9,7 @@ from readthedocs.projects.models import Project, Feature from readthedocs.rtd_tests.base import RTDTestCase -from readthedocs.rtd_tests.utils import make_test_git, make_test_hg +from readthedocs.rtd_tests.utils import create_tag, make_test_git, make_test_hg class TestGitBackend(RTDTestCase): @@ -57,6 +57,19 @@ def test_git_checkout(self): repo.checkout() self.assertTrue(exists(repo.working_dir)) + def test_git_tags(self): + repo_path = self.project.repo + create_tag(repo_path, 'v01') + create_tag(repo_path, 'v02', annotated=True) + create_tag(repo_path, 'release-ünîø∂é') + repo = self.project.vcs_repo() + # Hack the repo path + repo.working_dir = repo_path + self.assertEqual( + set(['v01', 'v02', 'release-ünîø∂é']), + set(vcs.verbose_name for vcs in repo.tags) + ) + def test_check_for_submodules(self): repo = self.project.vcs_repo() diff --git a/readthedocs/rtd_tests/utils.py b/readthedocs/rtd_tests/utils.py index 420cc70746c..d8a52072e03 100644 --- a/readthedocs/rtd_tests/utils.py +++ b/readthedocs/rtd_tests/utils.py @@ -89,12 +89,24 @@ def make_test_git(): # Checkout to master branch again check_output(['git', 'checkout', 'master'], env=env) - - # Create some tags chdir(path) return directory +def create_tag(directory, tag, annotated=False): + env = environ.copy() + env['GIT_DIR'] = pjoin(directory, '.git') + path = getcwd() + chdir(directory) + + command = ['git', 'tag'] + if annotated: + command.extend(['-a', '-m', 'Some tag']) + command.append(tag) + check_output(command, env=env) + chdir(path) + + def make_test_hg(): directory = mkdtemp() path = getcwd() From 5f5b51a2014e40a1adcff0ed2b6c8f0b13bd9ad4 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Mon, 7 May 2018 18:45:45 -0500 Subject: [PATCH 04/14] Remove unicode test --- readthedocs/rtd_tests/tests/test_backend.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/readthedocs/rtd_tests/tests/test_backend.py b/readthedocs/rtd_tests/tests/test_backend.py index f13b1d00095..871709daef7 100644 --- a/readthedocs/rtd_tests/tests/test_backend.py +++ b/readthedocs/rtd_tests/tests/test_backend.py @@ -61,12 +61,11 @@ def test_git_tags(self): repo_path = self.project.repo create_tag(repo_path, 'v01') create_tag(repo_path, 'v02', annotated=True) - create_tag(repo_path, 'release-ünîø∂é') repo = self.project.vcs_repo() # Hack the repo path repo.working_dir = repo_path self.assertEqual( - set(['v01', 'v02', 'release-ünîø∂é']), + set(['v01', 'v02']), set(vcs.verbose_name for vcs in repo.tags) ) From d050221065692e3a69198e3f35b3c2c2341943de Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Tue, 8 May 2018 14:02:05 -0500 Subject: [PATCH 05/14] Unicode test for python3 only --- readthedocs/rtd_tests/tests/test_backend.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/readthedocs/rtd_tests/tests/test_backend.py b/readthedocs/rtd_tests/tests/test_backend.py index 871709daef7..5b45cebc0f3 100644 --- a/readthedocs/rtd_tests/tests/test_backend.py +++ b/readthedocs/rtd_tests/tests/test_backend.py @@ -1,7 +1,10 @@ +# -*- coding: utf-8 -*- + from __future__ import absolute_import from os.path import exists import pytest +import six from django.contrib.auth.models import User import django_dynamic_fixture as fixture @@ -69,6 +72,18 @@ def test_git_tags(self): set(vcs.verbose_name for vcs in repo.tags) ) + @pytest.mark.skipif(six.PY2, reason='Python 3 only') + def test_git_tags_unicode(self): + repo_path = self.project.repo + create_tag(repo_path, 'release-ünîø∂é') + repo = self.project.vcs_repo() + # Hack the repo path + repo.working_dir = repo_path + self.assertEqual( + ['release-ünîø∂é'], + [vcs.verbose_name for vcs in repo.tags] + ) + def test_check_for_submodules(self): repo = self.project.vcs_repo() From b6597481717f727deb74e957cd44aacec1822916 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Tue, 8 May 2018 14:11:21 -0500 Subject: [PATCH 06/14] Refactor --- readthedocs/rtd_tests/tests/test_backend.py | 8 ++++---- readthedocs/rtd_tests/utils.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/readthedocs/rtd_tests/tests/test_backend.py b/readthedocs/rtd_tests/tests/test_backend.py index 5b45cebc0f3..264efd5acf0 100644 --- a/readthedocs/rtd_tests/tests/test_backend.py +++ b/readthedocs/rtd_tests/tests/test_backend.py @@ -12,7 +12,7 @@ from readthedocs.projects.models import Project, Feature from readthedocs.rtd_tests.base import RTDTestCase -from readthedocs.rtd_tests.utils import create_tag, make_test_git, make_test_hg +from readthedocs.rtd_tests.utils import create_git_tag, make_test_git, make_test_hg class TestGitBackend(RTDTestCase): @@ -62,8 +62,8 @@ def test_git_checkout(self): def test_git_tags(self): repo_path = self.project.repo - create_tag(repo_path, 'v01') - create_tag(repo_path, 'v02', annotated=True) + create_git_tag(repo_path, 'v01') + create_git_tag(repo_path, 'v02', annotated=True) repo = self.project.vcs_repo() # Hack the repo path repo.working_dir = repo_path @@ -75,7 +75,7 @@ def test_git_tags(self): @pytest.mark.skipif(six.PY2, reason='Python 3 only') def test_git_tags_unicode(self): repo_path = self.project.repo - create_tag(repo_path, 'release-ünîø∂é') + create_git_tag(repo_path, 'release-ünîø∂é') repo = self.project.vcs_repo() # Hack the repo path repo.working_dir = repo_path diff --git a/readthedocs/rtd_tests/utils.py b/readthedocs/rtd_tests/utils.py index d8a52072e03..9421b3d71f0 100644 --- a/readthedocs/rtd_tests/utils.py +++ b/readthedocs/rtd_tests/utils.py @@ -93,7 +93,7 @@ def make_test_git(): return directory -def create_tag(directory, tag, annotated=False): +def create_git_tag(directory, tag, annotated=False): env = environ.copy() env['GIT_DIR'] = pjoin(directory, '.git') path = getcwd() From e3e5f87b934b5f5289c00e7d97573d2796997a38 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Tue, 8 May 2018 14:15:11 -0500 Subject: [PATCH 07/14] Trying to fix test on travis --- readthedocs/rtd_tests/tests/test_backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readthedocs/rtd_tests/tests/test_backend.py b/readthedocs/rtd_tests/tests/test_backend.py index 264efd5acf0..fe8da1a8530 100644 --- a/readthedocs/rtd_tests/tests/test_backend.py +++ b/readthedocs/rtd_tests/tests/test_backend.py @@ -75,7 +75,7 @@ def test_git_tags(self): @pytest.mark.skipif(six.PY2, reason='Python 3 only') def test_git_tags_unicode(self): repo_path = self.project.repo - create_git_tag(repo_path, 'release-ünîø∂é') + create_git_tag(repo_path, 'release-ünîø∂é'.encode()) repo = self.project.vcs_repo() # Hack the repo path repo.working_dir = repo_path From 851d2b81f9db13dcfceb9bed3f01cecda9f153e2 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Tue, 8 May 2018 14:55:25 -0500 Subject: [PATCH 08/14] Fix unicode tests --- readthedocs/rtd_tests/tests/test_backend.py | 16 ++-------------- readthedocs/rtd_tests/utils.py | 10 ++++------ 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/readthedocs/rtd_tests/tests/test_backend.py b/readthedocs/rtd_tests/tests/test_backend.py index fe8da1a8530..d742665a3e2 100644 --- a/readthedocs/rtd_tests/tests/test_backend.py +++ b/readthedocs/rtd_tests/tests/test_backend.py @@ -4,7 +4,6 @@ from os.path import exists import pytest -import six from django.contrib.auth.models import User import django_dynamic_fixture as fixture @@ -64,26 +63,15 @@ def test_git_tags(self): repo_path = self.project.repo create_git_tag(repo_path, 'v01') create_git_tag(repo_path, 'v02', annotated=True) + create_git_tag(repo_path, 'release-ünîø∂é') repo = self.project.vcs_repo() # Hack the repo path repo.working_dir = repo_path self.assertEqual( - set(['v01', 'v02']), + set(['v01', 'v02', 'release-ünîø∂é']), set(vcs.verbose_name for vcs in repo.tags) ) - @pytest.mark.skipif(six.PY2, reason='Python 3 only') - def test_git_tags_unicode(self): - repo_path = self.project.repo - create_git_tag(repo_path, 'release-ünîø∂é'.encode()) - repo = self.project.vcs_repo() - # Hack the repo path - repo.working_dir = repo_path - self.assertEqual( - ['release-ünîø∂é'], - [vcs.verbose_name for vcs in repo.tags] - ) - def test_check_for_submodules(self): repo = self.project.vcs_repo() diff --git a/readthedocs/rtd_tests/utils.py b/readthedocs/rtd_tests/utils.py index 9421b3d71f0..be85a67dbe9 100644 --- a/readthedocs/rtd_tests/utils.py +++ b/readthedocs/rtd_tests/utils.py @@ -16,12 +16,10 @@ log = logging.getLogger(__name__) -def check_output(l, env=()): - if env == (): - output = subprocess.Popen(l, stdout=subprocess.PIPE).communicate()[0] - else: - output = subprocess.Popen(l, stdout=subprocess.PIPE, - env=env).communicate()[0] +def check_output(l, env=None): + output = subprocess.Popen( + l, stdout=subprocess.PIPE, universal_newlines=True, env=env + ).communicate()[0] log.info(output) return output From a6a60d57132d894570bb21301aa416bb658681d1 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Thu, 10 May 2018 19:13:38 -0500 Subject: [PATCH 09/14] Try to fix travis... Again --- readthedocs/rtd_tests/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readthedocs/rtd_tests/utils.py b/readthedocs/rtd_tests/utils.py index be85a67dbe9..01ab90d6e99 100644 --- a/readthedocs/rtd_tests/utils.py +++ b/readthedocs/rtd_tests/utils.py @@ -18,7 +18,8 @@ def check_output(l, env=None): output = subprocess.Popen( - l, stdout=subprocess.PIPE, universal_newlines=True, env=env + l, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + universal_newlines=True, env=env ).communicate()[0] log.info(output) return output From 65409a8059c950cee70baa9884fc9d83aaff892a Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Wed, 16 May 2018 16:34:02 -0500 Subject: [PATCH 10/14] Literal unicode --- readthedocs/rtd_tests/tests/test_backend.py | 2 +- readthedocs/rtd_tests/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/readthedocs/rtd_tests/tests/test_backend.py b/readthedocs/rtd_tests/tests/test_backend.py index d742665a3e2..404d447bc6a 100644 --- a/readthedocs/rtd_tests/tests/test_backend.py +++ b/readthedocs/rtd_tests/tests/test_backend.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import +from __future__ import absolute_import, unicode_literals from os.path import exists import pytest diff --git a/readthedocs/rtd_tests/utils.py b/readthedocs/rtd_tests/utils.py index 01ab90d6e99..86f900b3b95 100644 --- a/readthedocs/rtd_tests/utils.py +++ b/readthedocs/rtd_tests/utils.py @@ -1,6 +1,6 @@ """Utility functions for use in tests.""" -from __future__ import absolute_import +from __future__ import absolute_import, unicode_literals import logging import subprocess From 472eadf42912aa9d70e951e6a8f7eba5380cbe15 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Wed, 16 May 2018 16:38:42 -0500 Subject: [PATCH 11/14] Use str from builtins --- readthedocs/vcs_support/backends/git.py | 1 + 1 file changed, 1 insertion(+) diff --git a/readthedocs/vcs_support/backends/git.py b/readthedocs/vcs_support/backends/git.py index 9248b72da6d..cde60e337de 100644 --- a/readthedocs/vcs_support/backends/git.py +++ b/readthedocs/vcs_support/backends/git.py @@ -17,6 +17,7 @@ from readthedocs.core.validators import validate_submodule_url from readthedocs.projects.exceptions import RepositoryError from readthedocs.vcs_support.base import BaseVCS, VCSVersion +from builtins import str log = logging.getLogger(__name__) From d3e3b5b442967cbba64fb84bc2ac23fda0818575 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Wed, 16 May 2018 16:39:31 -0500 Subject: [PATCH 12/14] Remove universal_newlines --- readthedocs/rtd_tests/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readthedocs/rtd_tests/utils.py b/readthedocs/rtd_tests/utils.py index 86f900b3b95..55f7f70b168 100644 --- a/readthedocs/rtd_tests/utils.py +++ b/readthedocs/rtd_tests/utils.py @@ -16,10 +16,10 @@ log = logging.getLogger(__name__) -def check_output(l, env=None): +def check_output(command, env=None): output = subprocess.Popen( - l, stdout=subprocess.PIPE, stderr=subprocess.PIPE, - universal_newlines=True, env=env + command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + env=env ).communicate()[0] log.info(output) return output From f4c53c850ad6d813512396d19cf8d3f23099643f Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Wed, 16 May 2018 16:48:26 -0500 Subject: [PATCH 13/14] Set magic environment variable --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index e4ea2e3add4..92a89f53309 100644 --- a/tox.ini +++ b/tox.ini @@ -14,6 +14,7 @@ setenv = PYTHONPATH={toxinidir}/readthedocs:{toxinidir} DJANGO_SETTINGS_MODULE=readthedocs.settings.test LANG=C + LC_CTYPE=C.UTF-8 DJANGO_SETTINGS_SKIP_LOCAL=True deps = -r{toxinidir}/requirements/testing.txt changedir = {toxinidir}/readthedocs From fdba591c52d59c8b50cb9fbd8d72897542a37856 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Wed, 16 May 2018 17:08:08 -0500 Subject: [PATCH 14/14] Better comment --- readthedocs/rtd_tests/tests/test_backend.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readthedocs/rtd_tests/tests/test_backend.py b/readthedocs/rtd_tests/tests/test_backend.py index 404d447bc6a..21ca978a405 100644 --- a/readthedocs/rtd_tests/tests/test_backend.py +++ b/readthedocs/rtd_tests/tests/test_backend.py @@ -65,7 +65,8 @@ def test_git_tags(self): create_git_tag(repo_path, 'v02', annotated=True) create_git_tag(repo_path, 'release-ünîø∂é') repo = self.project.vcs_repo() - # Hack the repo path + # We aren't cloning the repo, + # so we need to hack the repo path repo.working_dir = repo_path self.assertEqual( set(['v01', 'v02', 'release-ünîø∂é']),