Commit 6401f453 by Ned Batchelder

Change how conf/locale/eo is cleaned up, so that it always happens

parent dadc78aa
...@@ -3,12 +3,13 @@ This test tests that i18n extraction (`paver i18n_extract -v`) works properly. ...@@ -3,12 +3,13 @@ This test tests that i18n extraction (`paver i18n_extract -v`) works properly.
""" """
from datetime import datetime, timedelta from datetime import datetime, timedelta
import os import os
import sys
import string # pylint: disable=deprecated-module
import random import random
import re import re
import sys
import string
import subprocess
from unittest import TestCase from unittest import TestCase
from mock import patch from mock import patch
from polib import pofile from polib import pofile
from pytz import UTC from pytz import UTC
...@@ -41,6 +42,16 @@ class TestGenerate(TestCase): ...@@ -41,6 +42,16 @@ class TestGenerate(TestCase):
extract.main(verbosity=0) extract.main(verbosity=0)
dummy.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): def setUp(self):
# Subtract 1 second to help comparisons with file-modify time succeed, # Subtract 1 second to help comparisons with file-modify time succeed,
# since os.path.getmtime() is not millisecond-accurate # since os.path.getmtime() is not millisecond-accurate
......
...@@ -115,9 +115,6 @@ def test_lib(options): ...@@ -115,9 +115,6 @@ def test_lib(options):
test_suite = suites.PythonTestSuite('python tests', subsuites=lib_tests, **opts) test_suite = suites.PythonTestSuite('python tests', subsuites=lib_tests, **opts)
test_suite.run() test_suite.run()
# Clear the Esperanto directory of any test artifacts
sh('git checkout conf/locale/eo')
@task @task
@needs( @needs(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment