Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 from __future__ import unicode_literals | 1 from __future__ import unicode_literals |
2 | 2 |
3 import os | 3 import os |
4 import pytest | 4 import pytest |
5 import shutil | 5 import shutil |
6 | 6 |
7 pytest_plugins = [ | 7 pytest_plugins = [ |
8 'tests.xtm_conftest', | 8 'tests.xtm_conftest', |
9 ] | 9 ] |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... | |
22 shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir) | 22 shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir) |
23 yield site_dir | 23 yield site_dir |
24 | 24 |
25 | 25 |
26 @pytest.fixture(scope='session') | 26 @pytest.fixture(scope='session') |
27 def temp_site_with_conflicts(tmpdir_factory): | 27 def temp_site_with_conflicts(tmpdir_factory): |
28 out_dir = tmpdir_factory.mktemp('temp_out_conflicts') | 28 out_dir = tmpdir_factory.mktemp('temp_out_conflicts') |
29 site_dir = out_dir.join('test_site').strpath | 29 site_dir = out_dir.join('test_site').strpath |
30 | 30 |
31 shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir) | 31 shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir) |
32 with open(os.path.join(site_dir, 'locales', 'en', 'translate'), 'w') \ | 32 translate_file = os.path.join(site_dir, 'locales', 'en', 'translate') |
Vasily Kuznetsov
2018/10/22 14:36:47
Nit: maybe construct the path in a separate line t
Tudor Avram
2018/10/23 16:44:34
Done.
| |
33 as f: | 33 with open(translate_file, 'w') as f: |
34 f.write('Page with conflicts') | 34 f.write('Page with conflicts') |
35 | 35 |
36 yield site_dir | 36 yield site_dir |
LEFT | RIGHT |