@@ -142,110 +142,6 @@ def test_discover_simple(self):
142142 ],
143143 )
144144
145- def test_discover_complex_default (self ):
146- projroot , testroot = resolve_testroot ("complex" )
147- expected = self .complex (projroot )
148- expected [0 ]["tests" ] = fix_test_order (expected [0 ]["tests" ])
149- if sys .version_info < (3 ,):
150- decorated = [
151- "./tests/test_unittest.py::MyTests::test_skipped" ,
152- "./tests/test_unittest.py::MyTests::test_maybe_skipped" ,
153- "./tests/test_unittest.py::MyTests::test_maybe_not_skipped" ,
154- ]
155- for testid in decorated :
156- fix_source (expected [0 ]["tests" ], testid , None , 0 )
157-
158- out = run_adapter ("discover" , "pytest" , "--rootdir" , projroot , testroot )
159- result = json .loads (out )
160- result [0 ]["tests" ] = fix_test_order (result [0 ]["tests" ])
161-
162- self .maxDiff = None
163- self .assertEqual (result , expected )
164-
165- def test_discover_complex_doctest (self ):
166- projroot , _ = resolve_testroot ("complex" )
167- expected = self .complex (projroot )
168- # add in doctests from test suite
169- expected [0 ]["parents" ].insert (
170- 3 ,
171- {
172- "id" : "./tests/test_doctest.py" ,
173- "kind" : "file" ,
174- "name" : "test_doctest.py" ,
175- "relpath" : fix_path ("./tests/test_doctest.py" ),
176- "parentid" : "./tests" ,
177- },
178- )
179- expected [0 ]["tests" ].insert (
180- 2 ,
181- {
182- "id" : "./tests/test_doctest.py::tests.test_doctest" ,
183- "name" : "tests.test_doctest" ,
184- "source" : fix_path ("./tests/test_doctest.py:1" ),
185- "markers" : [],
186- "parentid" : "./tests/test_doctest.py" ,
187- },
188- )
189- # add in doctests from non-test module
190- expected [0 ]["parents" ].insert (
191- 0 ,
192- {
193- "id" : "./mod.py" ,
194- "kind" : "file" ,
195- "name" : "mod.py" ,
196- "relpath" : fix_path ("./mod.py" ),
197- "parentid" : "." ,
198- },
199- )
200- expected [0 ]["tests" ] = [
201- {
202- "id" : "./mod.py::mod" ,
203- "name" : "mod" ,
204- "source" : fix_path ("./mod.py:1" ),
205- "markers" : [],
206- "parentid" : "./mod.py" ,
207- },
208- {
209- "id" : "./mod.py::mod.Spam" ,
210- "name" : "mod.Spam" ,
211- "source" : fix_path ("./mod.py:33" ),
212- "markers" : [],
213- "parentid" : "./mod.py" ,
214- },
215- {
216- "id" : "./mod.py::mod.Spam.eggs" ,
217- "name" : "mod.Spam.eggs" ,
218- "source" : fix_path ("./mod.py:43" ),
219- "markers" : [],
220- "parentid" : "./mod.py" ,
221- },
222- {
223- "id" : "./mod.py::mod.square" ,
224- "name" : "mod.square" ,
225- "source" : fix_path ("./mod.py:18" ),
226- "markers" : [],
227- "parentid" : "./mod.py" ,
228- },
229- ] + expected [0 ]["tests" ]
230- expected [0 ]["tests" ] = fix_test_order (expected [0 ]["tests" ])
231- if sys .version_info < (3 ,):
232- decorated = [
233- "./tests/test_unittest.py::MyTests::test_skipped" ,
234- "./tests/test_unittest.py::MyTests::test_maybe_skipped" ,
235- "./tests/test_unittest.py::MyTests::test_maybe_not_skipped" ,
236- ]
237- for testid in decorated :
238- fix_source (expected [0 ]["tests" ], testid , None , 0 )
239-
240- out = run_adapter (
241- "discover" , "pytest" , "--rootdir" , projroot , "--doctest-modules" , projroot
242- )
243- result = json .loads (out )
244- result [0 ]["tests" ] = fix_test_order (result [0 ]["tests" ])
245-
246- self .maxDiff = None
247- self .assertEqual (result , expected )
248-
249145 def test_discover_not_found (self ):
250146 projroot , testroot = resolve_testroot ("notests" )
251147
0 commit comments