Skip to content

Commit 3d70c9e

Browse files
authored
Merge pull request #187 from iMichka/pytest6
Tests: move another batch to pytest
2 parents dc05032 + 3c8d87d commit 3d70c9e

13 files changed

+11
-20
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
*.pyo
33
*~
44
docs/_build
5+
tests/temp
6+
tests/data/pygccxml.cache
7+
tests/data/directory_cache_test
8+
tests/data/ogre.1.7.xml
59
unittests/temp
610
unittests/data/pygccxml.cache
711
unittests/data/directory_cache_test

tests/autoconfig.py

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
data_directory = os.path.join(this_module_dir_path, '../unittests', 'data')
1919
build_directory = os.path.join(this_module_dir_path, 'temp')
2020

21+
if not os.path.exists(build_directory):
22+
os.makedirs(build_directory)
23+
2124
sys.path.insert(1, os.path.join(os.curdir, '..'))
2225
# The tests are run on the parent pygccxml directory, not the one
2326
# in site-packages. Insert the directory's path.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

unittests/xmlfile_reader_tester.py renamed to tests/test_xmlfile_reader.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __init__(self, *args):
2020
self.__fname = 'core_types.hpp'
2121
# self.__fname = 'merge_free_functions.hpp'
2222

23-
def test(self):
23+
def test_read_xml_file(self):
2424
src_reader = parser.source_reader_t(self.config)
2525
src_decls = src_reader.read_file(self.__fname)
2626

unittests/autoconfig.py

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
data_directory = os.path.join(this_module_dir_path, 'data')
2222
build_directory = os.path.join(this_module_dir_path, 'temp')
2323

24+
if not os.path.exists(build_directory):
25+
os.makedirs(build_directory)
26+
2427
# We want to make sure we throw an error for ALL the warnings during the
2528
# tests. This will allow us to be notified by the build bots, so that the
2629
# warnings can be fixed.

unittests/declarations_cache_tester.py

-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616

1717
class Test(parser_test_case.parser_test_case_t):
1818

19-
def __init__(self, *args):
20-
parser_test_case.parser_test_case_t.__init__(self, *args)
21-
if not os.path.exists(autoconfig.build_directory):
22-
os.makedirs(autoconfig.build_directory)
23-
2419
def test_file_signature(self):
2520
file1 = os.path.join(autoconfig.data_directory, 'decl_cache_file1.txt')
2621
file1_dup = os.path.join(

unittests/test_all.py

-14
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,19 @@
1818
from . import source_reader_tester
1919
from . import start_with_declarations_tester
2020
from . import templates_tester
21-
from . import type_traits_tester
2221
from . import core_tester
23-
from . import xmlfile_reader_tester
2422
from . import hierarchy_traveling
2523
from . import patcher_tester
2624
from . import call_invocation_tester
2725
from . import bit_fields_tester
2826
from . import complex_types_tester
2927
from . import cached_source_file_tester
30-
from . import variable_matcher_tester
3128
from . import namespace_matcher_tester
3229
from . import calldef_matcher_tester
3330
from . import filters_tester
3431
from . import cache_enums_tester
3532
from . import decl_printer_tester
36-
from . import typedefs_tester
3733
from . import non_copyable_classes_tester
38-
from . import unnamed_enums_bug_tester
3934
from . import vector_traits_tester
4035
from . import string_traits_tester
4136
from . import declarations_cache_tester
@@ -44,7 +39,6 @@
4439
from . import free_operators_tester
4540
from . import remove_template_defaults_tester
4641
from . import find_container_traits_tester
47-
from . import type_as_exception_bug_tester
4842
from . import copy_constructor_tester
4943
from . import plain_c_tester
5044
from . import function_traits_tester
@@ -56,7 +50,6 @@
5650
from . import gccxml10185_tester
5751
from . import inline_specifier_tester
5852
from . import example_tester
59-
from . import unnamed_classes_tester
6053
from . import test_directory_cache
6154
from . import deprecation_tester
6255
from . import test_overrides
@@ -72,27 +65,22 @@
7265
start_with_declarations_tester,
7366
templates_tester,
7467
core_tester,
75-
xmlfile_reader_tester,
7668
hierarchy_traveling,
7769
call_invocation_tester,
7870
bit_fields_tester,
7971
complex_types_tester,
8072
cached_source_file_tester,
81-
variable_matcher_tester,
8273
namespace_matcher_tester,
8374
calldef_matcher_tester,
8475
filters_tester,
8576
cache_enums_tester,
86-
typedefs_tester,
8777
non_copyable_classes_tester,
88-
unnamed_enums_bug_tester,
8978
vector_traits_tester,
9079
string_traits_tester,
9180
declarations_cache_tester,
9281
has_binary_operator_traits_tester,
9382
dependencies_tester,
9483
free_operators_tester,
95-
type_as_exception_bug_tester,
9684
plain_c_tester,
9785
function_traits_tester,
9886
better_templates_matcher_tester,
@@ -102,10 +90,8 @@
10290
gccxml10184_tester,
10391
gccxml10185_tester,
10492
inline_specifier_tester,
105-
unnamed_classes_tester,
10693
test_directory_cache,
10794
decl_printer_tester,
108-
type_traits_tester,
10995
remove_template_defaults_tester,
11096
patcher_tester,
11197
find_container_traits_tester,

0 commit comments

Comments
 (0)