##// END OF EJS Templates
Fixes to testing system: ipdocetst plugin wasn't being properly loaded.
Fernando Perez -
Show More
@@ -1,4 +1,3 b''
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
3 """IPython Test Suite Runner.
2 """IPython Test Suite Runner.
4 """
3 """
@@ -18,28 +17,18 b' def main():'
18 warnings.filterwarnings('ignore',
17 warnings.filterwarnings('ignore',
19 'This will be removed soon. Use IPython.testing.util instead')
18 'This will be removed soon. Use IPython.testing.util instead')
20
19
21
20 argv = sys.argv + [ '--with-ipdoctest',
22 # construct list of plugins, omitting the existing doctest plugin
21 '--doctest-tests','--doctest-extension=txt',
23 plugins = [IPythonDoctest()]
22 '--detailed-errors',
24 for p in nose.plugins.builtin.plugins:
25 plug = p()
26 if plug.name == 'doctest':
27 continue
28
29 #print 'adding plugin:',plug.name # dbg
30 plugins.append(plug)
31
32 argv = sys.argv + ['--doctest-tests','--doctest-extension=txt',
33 '--detailed-errors',
34
23
35 # We add --exe because of setuptools' imbecility (it
24 # We add --exe because of setuptools' imbecility (it
36 # blindly does chmod +x on ALL files). Nose does the
25 # blindly does chmod +x on ALL files). Nose does the
37 # right thing and it tries to avoid executables,
26 # right thing and it tries to avoid executables,
38 # setuptools unfortunately forces our hand here. This
27 # setuptools unfortunately forces our hand here. This
39 # has been discussed on the distutils list and the
28 # has been discussed on the distutils list and the
40 # setuptools devs refuse to fix this problem!
29 # setuptools devs refuse to fix this problem!
41 '--exe',
30 '--exe',
42 ]
31 ]
43
32
44 has_ip = False
33 has_ip = False
45 for arg in sys.argv:
34 for arg in sys.argv:
@@ -50,4 +39,15 b' def main():'
50 if not has_ip:
39 if not has_ip:
51 argv.append('IPython')
40 argv.append('IPython')
52
41
42 # construct list of plugins, omitting the existing doctest plugin
43 plugins = [IPythonDoctest()]
44 for p in nose.plugins.builtin.plugins:
45 plug = p()
46 if plug.name == 'doctest':
47 continue
48
49 #print '*** adding plugin:',plug.name # dbg
50 plugins.append(plug)
51
52
53 TestProgram(argv=argv,plugins=plugins)
53 TestProgram(argv=argv,plugins=plugins)
@@ -36,8 +36,8 b' deco:'
36 magic: plugin
36 magic: plugin
37 $(NOSE) IPython.Magic
37 $(NOSE) IPython.Magic
38
38
39 ipipe: plugin
39 excolors: plugin
40 $(NOSE) IPython.Extensions.ipipe
40 $(NOSE) IPython.excolors
41
41
42 iplib: plugin
42 iplib: plugin
43 $(NOSE) IPython.iplib
43 $(NOSE) IPython.iplib
@@ -688,6 +688,7 b' class ExtensionDoctest(doctests.Doctest):'
688 self.globs = None
688 self.globs = None
689 self.extraglobs = None
689 self.extraglobs = None
690
690
691
691 def loadTestsFromExtensionModule(self,filename):
692 def loadTestsFromExtensionModule(self,filename):
692 bpath,mod = os.path.split(filename)
693 bpath,mod = os.path.split(filename)
693 modname = os.path.splitext(mod)[0]
694 modname = os.path.splitext(mod)[0]
@@ -703,8 +704,8 b' class ExtensionDoctest(doctests.Doctest):'
703 # a few modifications to control output checking.
704 # a few modifications to control output checking.
704
705
705 def loadTestsFromModule(self, module):
706 def loadTestsFromModule(self, module):
706 #print 'lTM',module # dbg
707 #print '*** ipdoctest - lTM',module # dbg
707
708
708 if not self.matches(module.__name__):
709 if not self.matches(module.__name__):
709 log.debug("Doctest doesn't want module %s", module)
710 log.debug("Doctest doesn't want module %s", module)
710 return
711 return
@@ -733,8 +734,6 b' class ExtensionDoctest(doctests.Doctest):'
733
734
734
735
735 def loadTestsFromFile(self, filename):
736 def loadTestsFromFile(self, filename):
736 #print 'lTF',filename # dbg
737
738 if is_extension_module(filename):
737 if is_extension_module(filename):
739 for t in self.loadTestsFromExtensionModule(filename):
738 for t in self.loadTestsFromExtensionModule(filename):
740 yield t
739 yield t
@@ -761,7 +760,7 b' class ExtensionDoctest(doctests.Doctest):'
761 Modified version that accepts extension modules as valid containers for
760 Modified version that accepts extension modules as valid containers for
762 doctests.
761 doctests.
763 """
762 """
764 print 'Filename:',filename # dbg
763 #print '*** ipdoctest- wantFile:',filename # dbg
765
764
766 # XXX - temporarily hardcoded list, will move to driver later
765 # XXX - temporarily hardcoded list, will move to driver later
767 exclude = ['IPython/external/',
766 exclude = ['IPython/external/',
@@ -791,7 +790,7 b' class IPythonDoctest(ExtensionDoctest):'
791 """
790 """
792 name = 'ipdoctest' # call nosetests with --with-ipdoctest
791 name = 'ipdoctest' # call nosetests with --with-ipdoctest
793 enabled = True
792 enabled = True
794
793
795 def configure(self, options, config):
794 def configure(self, options, config):
796
795
797 Plugin.configure(self, options, config)
796 Plugin.configure(self, options, config)
General Comments 0
You need to be logged in to leave comments. Login now