10
10
import sys
11
11
import unittest
12
12
13
- import pytest
14
-
15
13
from ...__main__ import TESTING_TOOLS_ROOT
16
14
from testing_tools .adapter .util import fix_path , PATH_SEP
17
15
@@ -83,6 +81,15 @@ def fix_source(tests, testid, srcfile, lineno):
83
81
test ["source" ] = fix_path ("{}:{}" .format (srcfile , lineno ))
84
82
85
83
84
+ def sorted_object (obj ):
85
+ if isinstance (obj , dict ):
86
+ return sorted ((key , sorted_object (obj [key ])) for key in obj .keys ())
87
+ if isinstance (obj , list ):
88
+ return sorted ((sorted_object (x ) for x in obj ))
89
+ else :
90
+ return obj
91
+
92
+
86
93
# Note that these tests are skipped if util.PATH_SEP is not os.path.sep.
87
94
# This is because the functional tests should reflect the actual
88
95
# operating environment.
@@ -141,7 +148,6 @@ def test_discover_simple(self):
141
148
],
142
149
)
143
150
144
- @pytest .mark .skip (reason = "https://github.com/microsoft/vscode-python/issues/14023" )
145
151
def test_discover_complex_default (self ):
146
152
projroot , testroot = resolve_testroot ("complex" )
147
153
expected = self .complex (projroot )
@@ -160,9 +166,8 @@ def test_discover_complex_default(self):
160
166
result [0 ]["tests" ] = fix_test_order (result [0 ]["tests" ])
161
167
162
168
self .maxDiff = None
163
- self .assertEqual (result , expected )
169
+ self .assertEqual (sorted_object ( result ), sorted_object ( expected ) )
164
170
165
- @pytest .mark .skip (reason = "https://github.com/microsoft/vscode-python/issues/14023" )
166
171
def test_discover_complex_doctest (self ):
167
172
projroot , _ = resolve_testroot ("complex" )
168
173
expected = self .complex (projroot )
@@ -245,7 +250,7 @@ def test_discover_complex_doctest(self):
245
250
result [0 ]["tests" ] = fix_test_order (result [0 ]["tests" ])
246
251
247
252
self .maxDiff = None
248
- self .assertEqual (result , expected )
253
+ self .assertEqual (sorted_object ( result ), sorted_object ( expected ) )
249
254
250
255
def test_discover_not_found (self ):
251
256
projroot , testroot = resolve_testroot ("notests" )
0 commit comments