Merge pull request #7446 from edx/ned/clean-up-eo
Change how conf/locale/eo is cleaned up, so that it happens when needed
This commit is contained in:
@@ -3,12 +3,13 @@ This test tests that i18n extraction (`paver i18n_extract -v`) works properly.
|
||||
"""
|
||||
from datetime import datetime, timedelta
|
||||
import os
|
||||
import sys
|
||||
import string # pylint: disable=deprecated-module
|
||||
import random
|
||||
import re
|
||||
|
||||
import sys
|
||||
import string
|
||||
import subprocess
|
||||
from unittest import TestCase
|
||||
|
||||
from mock import patch
|
||||
from polib import pofile
|
||||
from pytz import UTC
|
||||
@@ -41,6 +42,16 @@ class TestGenerate(TestCase):
|
||||
extract.main(verbosity=0)
|
||||
dummy.main(verbosity=0)
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
# Clear the Esperanto directory of any test artifacts
|
||||
cmd = "git checkout conf/locale/eo"
|
||||
sys.stderr.write("Cleaning up eo: " + cmd)
|
||||
sys.stderr.flush()
|
||||
returncode = subprocess.call(cmd, shell=True)
|
||||
assert returncode == 0
|
||||
super(TestGenerate, cls).tearDownClass()
|
||||
|
||||
def setUp(self):
|
||||
# Subtract 1 second to help comparisons with file-modify time succeed,
|
||||
# since os.path.getmtime() is not millisecond-accurate
|
||||
|
||||
@@ -115,9 +115,6 @@ def test_lib(options):
|
||||
test_suite = suites.PythonTestSuite('python tests', subsuites=lib_tests, **opts)
|
||||
test_suite.run()
|
||||
|
||||
# Clear the Esperanto directory of any test artifacts
|
||||
sh('git checkout conf/locale/eo')
|
||||
|
||||
|
||||
@task
|
||||
@needs(
|
||||
|
||||
Reference in New Issue
Block a user