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

Unified Diff: tests/conftest.py

Issue 29755806: Noissue - convert test_page_outputs to pytest-regtest (Closed)
Patch Set: Combine page outputs Created April 23, 2018, 8:55 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/conftest.py
===================================================================
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,23 +1,29 @@
import os
import pytest
import shutil
import subprocess
-ROOTPATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+ROOT_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+TEST_SITE_PATH = os.path.join(ROOT_PATH, 'tests', 'test_site')
+PAGE_LIST = [
+ filename.split('.')[0]
+ for filename in os.listdir(os.path.join(TEST_SITE_PATH, 'pages'))
+]
+LANG_LIST = ['en', 'de']
@pytest.fixture(scope='session')
def temp_site(tmpdir_factory):
out_dir = tmpdir_factory.mktemp('temp_out')
site_dir = out_dir.join('test_site').strpath
- shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir)
+ shutil.copytree(TEST_SITE_PATH, site_dir)
subprocess.check_call(['hg', 'init', site_dir])
subprocess.check_call(['hg', '-R', site_dir, 'commit', '-A', '-m', 'foo'])
subprocess.check_call(['hg', '-R', site_dir, 'bookmark', 'master'])
subprocess.check_call(['hg', '-R', site_dir, 'bookmark', 'test'])
subprocess.check_call(['touch', os.path.join(site_dir, 'pages', 'bar.md')])
subprocess.check_call(['hg', '-R', site_dir, 'commit', '-A', '-m', 'bar'])
yield site_dir
« no previous file with comments | « tests/_regtest_outputs/test_page_outputs.test_static[master].out ('k') | tests/expected_output/de/translate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld