|
5 | 5 | from doctest import OutputChecker, ELLIPSIS
|
6 | 6 |
|
7 | 7 | from tests.lib import _create_test_package
|
8 |
| -from tests.lib.local_repos import local_checkout, local_repo |
9 | 8 |
|
10 | 9 |
|
11 | 10 | distribute_re = re.compile('^distribute==[0-9.]+\n', re.MULTILINE)
|
@@ -156,64 +155,48 @@ def test_freeze_git_clone(script, tmpdir):
|
156 | 155 | _check_output(result, expected)
|
157 | 156 |
|
158 | 157 |
|
159 |
| -@pytest.mark.network |
| 158 | +@pytest.mark.mercurial |
160 | 159 | def test_freeze_mercurial_clone(script, tmpdir):
|
161 | 160 | """
|
162 | 161 | Test freezing a Mercurial clone.
|
163 | 162 |
|
164 | 163 | """
|
| 164 | + # Returns path to a generated package called "version_pkg" |
| 165 | + pkg_version = _create_test_package(script, vcs='hg') |
| 166 | + |
165 | 167 | result = script.run(
|
166 |
| - 'hg', 'clone', |
167 |
| - '-r', 'c9963c111e7c', |
168 |
| - local_repo( |
169 |
| - 'hg+http://bitbucket.org/pypa/pip-test-package', |
170 |
| - tmpdir.join("cache"), |
171 |
| - ), |
172 |
| - 'pip-test-package', |
| 168 | + 'hg', 'clone', pkg_version, 'pip-test-package', |
| 169 | + expect_stderr=True, |
173 | 170 | )
|
| 171 | + repo_dir = script.scratch_path / 'pip-test-package' |
174 | 172 | result = script.run(
|
175 | 173 | 'python', 'setup.py', 'develop',
|
176 |
| - cwd=script.scratch_path / 'pip-test-package', |
| 174 | + cwd=repo_dir, |
177 | 175 | expect_stderr=True,
|
178 | 176 | )
|
179 | 177 | result = script.pip('freeze', expect_stderr=True)
|
180 | 178 | expected = textwrap.dedent(
|
181 | 179 | """
|
182 | 180 | Script result: ...pip freeze
|
183 | 181 | -- stdout: --------------------
|
184 |
| - ...-e %s@...#egg=pip_test_package-... |
| 182 | + ...-e hg+...#egg=version_pkg-dev |
185 | 183 | ...
|
186 |
| - """ % |
187 |
| - local_checkout( |
188 |
| - 'hg+http://bitbucket.org/pypa/pip-test-package', |
189 |
| - tmpdir.join("cache"), |
190 |
| - ), |
| 184 | + """ |
191 | 185 | ).strip()
|
192 | 186 | _check_output(result, expected)
|
193 | 187 |
|
194 | 188 | result = script.pip(
|
195 |
| - 'freeze', '-f', |
196 |
| - '%s#egg=pip_test_package' % |
197 |
| - local_checkout( |
198 |
| - 'hg+http://bitbucket.org/pypa/pip-test-package', |
199 |
| - tmpdir.join("cache"), |
200 |
| - ), |
| 189 | + 'freeze', '-f', '%s#egg=pip_test_package' % repo_dir, |
201 | 190 | expect_stderr=True,
|
202 | 191 | )
|
203 | 192 | expected = textwrap.dedent(
|
204 | 193 | """
|
205 |
| - Script result: ...pip freeze -f %(repo)s#egg=pip_test_package |
| 194 | + Script result: pip freeze -f %(repo)s#egg=pip_test_package |
206 | 195 | -- stdout: --------------------
|
207 |
| - -f %(repo)s#egg=pip_test_package |
208 |
| - ...-e %(repo)s@...#egg=pip_test_package-dev |
| 196 | + -f %(repo)s#egg=pip_test_package... |
| 197 | + ...-e hg+...#egg=version_pkg-dev |
209 | 198 | ...
|
210 |
| - """ % |
211 |
| - { |
212 |
| - 'repo': local_checkout( |
213 |
| - 'hg+http://bitbucket.org/pypa/pip-test-package', |
214 |
| - tmpdir.join("cache"), |
215 |
| - ), |
216 |
| - }, |
| 199 | + """ % {'repo': repo_dir}, |
217 | 200 | ).strip()
|
218 | 201 | _check_output(result, expected)
|
219 | 202 |
|
|
0 commit comments