-
Notifications
You must be signed in to change notification settings - Fork 5
/
test_examples.py
73 lines (61 loc) · 2.02 KB
/
test_examples.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Matthew S. Gillman, UCL, 22nd April 2021.
import os
import pytest
from ...pytest_files import functions
from . import run_examples_tests as ret
def setup():
"""
NB Not to be confused with set_up() in run_examples_tests.py!
"""
# Set up the environment.
this_dir = os.path.dirname(os.path.abspath(__file__))
(path_to_tests, _) = os.path.split(this_dir)
temp_dir = os.path.join(this_dir, 'temp')
functions.set_path_to_tests(path_to_tests)
if not os.path.isdir(temp_dir):
os.mkdir(temp_dir)
os.chdir(this_dir)
@pytest.mark.parametrize('name', [
('lo_children'),
('base_class'),
('qual'),
('spatial'),
# todo fails ('groups'), # This one was commented-out in run_examples_tests.py
])
def test_xml(name):
assert 0 == ret.run_xml_test(name)
@pytest.mark.parametrize('name, start, stop, number', [
("spatial", 8, 13, -1),
("spatial", 15, 19, -1),
("spatial", 22, 26, -1),
("spatial", 32, 36, -1),
("spatial", 41, 45, -1),
("spatial", 53, 54, -1),
("spatial", 60, 61, -1),
("spatial", 65, 66, -1),
# todo fails ("multi", 1, 2, 0), # This one was commented-out in run_examples_tests.py
])
def test_specific_xml_fail(name, start, stop, number):
"""
TODO: explanation needed.
:param name: XML file to parse
:param start:
:param stop:
:param number:
"""
assert 0 == ret.run_specific_xml_fail_tests(name, start, stop, number)
#########################################################################################################
# fails
# @pytest.mark.parametrize('name', [
# ('base_class'),
# # todo fails ('groups'), # This one was commented-out in run_examples_tests.py
# ])
# def test_xml_fail(name):
# assert 0 == ret.run_xml_fail_tests(name)
# fails
# @pytest.mark.parametrize('name', [
# ('qual'), # This one was commented-out in run_examples_tests.py
# ('lo_children'), # This one was commented-out in run_examples_tests.py
# ])
# def test_cpp(name):
# assert 0 == ret.run_test(name)