Skip to content

Commit a27e6fb

Browse files
author
Verbeke Victor
committed
Update test suite to include latin-1 and xfails
TN: V223-017
1 parent 2d160b0 commit a27e6fb

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

regtests/test_support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# Change directory
1010
TEST = sys.modules["__main__"]
11-
TESTDIR = os.path.dirname(TEST.__file__)
11+
TESTDIR = os.path.dirname(os.path.realpath(TEST.__file__))
1212
TEST_NAME = os.path.basename(TESTDIR)
1313
os.chdir(TESTDIR)
1414

regtests/testsuite.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,32 @@ def run(self):
3030
"""
3131
cmd = ["python", "test.py"]
3232
start_time = time.time()
33-
self.shell(cmd, catch_error=False)
33+
run = self.shell(cmd, catch_error=False)
3434
self.result.time = time.time() - start_time
3535

3636

3737
class TPTestFinder(TestFinder):
3838
"""Templates Parser test finder utility."""
3939

40+
latin1_tests = ["0064_testme"]
41+
xfail_tests = ["Z999_xfail"]
42+
4043
def probe(self, testsuite, dirpath, dirnames, filenames):
44+
test_env = {"testsuite_root_dir": testsuite.root_dir}
4145
if "test.py" in filenames:
4246
driver_cls = BasicTestDriver
47+
if os.path.basename(dirpath) in self.latin1_tests:
48+
test_env["encoding"] = "latin-1"
49+
if os.path.basename(dirpath) in self.xfail_tests:
50+
test_env["control"] = [["XFAIL", "True", "Should always fail."]]
4351
else:
4452
driver_cls = None
4553

4654
if driver_cls:
4755
return ParsedTest(
4856
test_name=testsuite.test_name(dirpath),
4957
driver_cls=driver_cls,
50-
test_env={"testsuite_root_dir": testsuite.root_dir},
58+
test_env=test_env,
5159
test_dir=dirpath,
5260
)
5361

0 commit comments

Comments
 (0)