Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: tests/conftest.py

Issue 29805580: Issue 6728 - Remove Mercurial dependency (Closed)
Patch Set: Addremove files to diff Created June 12, 2018, 11:01 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 import os 1 import os
2 import pytest 2 import pytest
3 import shutil 3 import shutil
4 import subprocess
5 4
6 5
7 ROOTPATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 6 ROOTPATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
8 7
9 8
10 @pytest.fixture(scope='session') 9 @pytest.fixture(scope='session')
11 def temp_site(tmpdir_factory): 10 def temp_site(tmpdir_factory):
12 out_dir = tmpdir_factory.mktemp('temp_out') 11 out_dir = tmpdir_factory.mktemp('temp_out')
13 site_dir = out_dir.join('test_site').strpath 12 site_dir = out_dir.join('test_site').strpath
14 13
15 shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir) 14 shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir)
16 subprocess.check_call(['hg', 'init', site_dir])
Vasily Kuznetsov 2018/06/13 13:35:23 Woohoo! All of this stuff GONE. Could even delete
Jon Sonesen 2018/06/14 19:24:14 Yeah that's a good idea, I reckon we should do thi
Vasily Kuznetsov 2018/07/03 08:50:24 I agree. Another commit would be better.
17 subprocess.check_call(['hg', '-R', site_dir, 'commit', '-A', '-m', 'foo'])
18
19 subprocess.check_call(['hg', '-R', site_dir, 'bookmark', 'master'])
20 subprocess.check_call(['hg', '-R', site_dir, 'bookmark', 'test'])
21 subprocess.check_call(['touch', os.path.join(site_dir, 'pages', 'bar.md')])
22 subprocess.check_call(['hg', '-R', site_dir, 'commit', '-A', '-m', 'bar'])
23 yield site_dir 15 yield site_dir
OLDNEW

Powered by Google App Engine
This is Rietveld