Skip to content

Commit 0c4f378

Browse files
authored
Convert Unittest testcases with setup/teardown to fixtures (#1240)
* Unwrap testcases with setup/teardown * Unwrap CLI testcases * De-global pot_file
1 parent 218c96e commit 0c4f378

File tree

7 files changed

+695
-788
lines changed

7 files changed

+695
-788
lines changed

tests/messages/consts.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
data_dir = os.path.join(this_dir, 'data')
1010
project_dir = os.path.join(data_dir, 'project')
1111
i18n_dir = os.path.join(project_dir, 'i18n')
12-
pot_file = os.path.join(i18n_dir, 'temp.pot')
1312

1413

1514
def get_po_file_path(locale):
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import pathlib
2+
import time
3+
4+
import pytest
5+
6+
7+
@pytest.fixture
8+
def pot_file(tmp_path) -> pathlib.Path:
9+
return tmp_path / f'po-{time.time()}.pot'

0 commit comments

Comments
 (0)