Skip to content

Commit c38291e

Browse files
committed
Merge pull request #2515 from msabramo/test_freeze_remove_dep_on_launchpad
Make test_freeze_bazaar_clone not depend on bazaar.launchpad.net
2 parents 8010608 + 7f5566f commit c38291e

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

tests/functional/test_freeze.py

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -218,41 +218,32 @@ def test_freeze_mercurial_clone(script, tmpdir):
218218
_check_output(result, expected)
219219

220220

221-
@pytest.mark.network
221+
@pytest.mark.bzr
222222
def test_freeze_bazaar_clone(script, tmpdir):
223223
"""
224224
Test freezing a Bazaar clone.
225225
226226
"""
227-
228-
checkout_path = local_checkout(
229-
'bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/'
230-
'release-0.1',
231-
tmpdir.join("cache"),
232-
)
233-
# bzr internally stores windows drives as uppercase; we'll match that.
227+
try:
228+
checkout_path = _create_test_package(script, vcs='bazaar')
229+
except OSError as e:
230+
pytest.fail('Invoking `bzr` failed: %s' % e)
234231
checkout_pathC = checkout_path.replace('c:', 'C:')
235232

236233
result = script.run(
237-
'bzr', 'checkout', '-r', '174',
238-
local_repo(
239-
'bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/'
240-
'release-0.1',
241-
tmpdir.join("cache"),
242-
),
243-
'django-wikiapp',
234+
'bzr', 'checkout', checkout_path, 'bzr-package'
244235
)
245236
result = script.run(
246237
'python', 'setup.py', 'develop',
247-
cwd=script.scratch_path / 'django-wikiapp',
238+
cwd=script.scratch_path / 'bzr-package',
248239
expect_stderr=True,
249240
)
250241
result = script.pip('freeze', expect_stderr=True)
251242
expected = textwrap.dedent("""\
252243
Script result: ...pip freeze
253244
-- stdout: --------------------
254-
...-e %s@...#egg=django_wikiapp-...
255-
...""" % checkout_pathC)
245+
...-e bzr+file://%s@1#egg=version_pkg-0.1-...
246+
...""" % checkout_path)
256247
_check_output(result, expected)
257248

258249
result = script.pip(
@@ -264,7 +255,7 @@ def test_freeze_bazaar_clone(script, tmpdir):
264255
Script result: ...pip freeze -f %(repo)s/#egg=django-wikiapp
265256
-- stdout: --------------------
266257
-f %(repo)s/#egg=django-wikiapp
267-
...-e %(repoC)s@...#egg=django_wikiapp-...
258+
...-e bzr+file://%(repoC)s@...#egg=version_pkg-...
268259
...""" % {'repoC': checkout_pathC, 'repo': checkout_path})
269260
_check_output(result, expected)
270261

tests/lib/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,17 @@ def main():
505505
checkout_path = checkout_path.replace('c:', 'C:')
506506

507507
version_pkg_path = checkout_path
508+
elif vcs == 'bazaar':
509+
script.run('bzr', 'init', cwd=version_pkg_path)
510+
script.run('bzr', 'add', '.', cwd=version_pkg_path)
511+
script.run(
512+
'bzr', 'whoami', 'pip <[email protected]>',
513+
cwd=version_pkg_path)
514+
script.run(
515+
'bzr', 'commit', '-q',
516+
'--author', 'pip <[email protected]>',
517+
'-m', 'initial version', cwd=version_pkg_path,
518+
)
508519
else:
509520
raise ValueError('Unknown vcs: %r' % vcs)
510521
return version_pkg_path

0 commit comments

Comments
 (0)