File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -284,11 +284,10 @@ def test_build_empty_tree() -> None:
284
284
start_dir = os .fsdecode (TEST_DATA_PATH )
285
285
pattern = "does_not_exist*"
286
286
287
- expected = None
288
-
289
287
loader = unittest .TestLoader ()
290
288
suite = loader .discover (start_dir , pattern )
291
289
tests , errors = build_test_tree (suite , start_dir )
292
290
293
- assert expected == tests
291
+ assert tests is not None
292
+ assert tests .get ("children" ) == []
294
293
assert not errors
Original file line number Diff line number Diff line change 3
3
4
4
import argparse
5
5
import atexit
6
+ import doctest
6
7
import enum
7
8
import inspect
8
9
import json
@@ -202,6 +203,12 @@ def build_test_tree(
202
203
root = build_test_node (top_level_directory , directory_path .name , TestNodeTypeEnum .folder )
203
204
204
205
for test_case in get_test_case (suite ):
206
+ if isinstance (test_case , doctest .DocTestCase ):
207
+ print (
208
+ "Skipping doctest as it is not supported for the extension. Test case: " , test_case
209
+ )
210
+ error = ["Skipping doctest as it is not supported for the extension." ]
211
+ continue
205
212
test_id = test_case .id ()
206
213
if test_id .startswith ("unittest.loader._FailedTest" ):
207
214
error .append (str (test_case ._exception )) # type: ignore # noqa: SLF001
@@ -255,9 +262,6 @@ def build_test_tree(
255
262
} # concatenate class name and function test name
256
263
current_node ["children" ].append (test_node )
257
264
258
- if not root ["children" ]:
259
- root = None
260
-
261
265
return root , error
262
266
263
267
You can’t perform that action at this time.
0 commit comments