コード例 #1
0
 def test_ignore_stdlib_maybe_c(self):
     # The atexit module is implemented in C in python 3.3, so it
     # has a different filename and path than under 2.7. However,
     # on some systems (Linux?) the module is not even a dll, it's
     # a builtin.
     if not hasattr(atexit, '__file__'):
         self.skipTest('atexit is a builtin')
     t = tracer.Tracer(None, include_stdlib=False)
     self.assertTrue(t._should_ignore_file(atexit.__file__))
コード例 #2
0
 def test_ignore_stdlib(self):
     t = tracer.Tracer(None, include_stdlib=False)
     os_path = os.path.abspath(os.__file__)
     LOG.debug('checking %s', os_path)
     self.assertIn(
         os.path.dirname(os_path) + os.sep,
         t._stdlibdirs,
     )
     LOG.debug('checking %s', os.__file__)
     self.assertTrue(
         t._should_ignore_file(os.__file__),
         'should ignore %s' % os.__file__,
     )
コード例 #3
0
ファイル: run.py プロジェクト: rayleyva/smiley
    def take_action(self, parsed_args):
        # Fix import path
        cwd = os.getcwd()
        if cwd not in sys.path and os.curdir not in sys.path:
            sys.path.insert(0, cwd)

        # Fix command line args
        sys.argv = parsed_args.command

        # Run the app
        p = publisher.Publisher(parsed_args.socket)
        t = tracer.Tracer(p)
        t.run(parsed_args.command)
        return
コード例 #4
0
    def test_interesting_locals(self):
        def _func():
            pass

        t = tracer.Tracer(None)
        f = mock.Mock()
        f.f_locals = {
            'simple_name': 1,
            'module': tracer,
            'function': _func,
            'method': self.setUp,
            '__magic__': 2,
        }
        interesting = t._get_interesting_locals(f)
        self.assertEqual(interesting, {'simple_name': 1})
コード例 #5
0
ファイル: run.py プロジェクト: religiose/smiley
    def take_action(self, parsed_args):
        # Fix import path
        cwd = os.getcwd()
        if cwd not in sys.path and os.curdir not in sys.path:
            sys.path.insert(0, cwd)

        # Fix command line args
        sys.argv = parsed_args.command

        # Run the app
        if parsed_args.mode == 'remote':
            p = publisher.Publisher(parsed_args.socket)
        else:
            p = local.LocalPublisher(parsed_args.database)
        t = tracer.Tracer(p)
        t.run(parsed_args.command)
        return
コード例 #6
0
 def test_include_site_packages(self):
     t = tracer.Tracer(None, include_site_packages=True)
     self.assertFalse(t._should_ignore_file(mock.__file__))
コード例 #7
0
 def test_ignore_site_packages(self):
     t = tracer.Tracer(None, include_site_packages=False)
     self.assertTrue(
         t._should_ignore_file(mock.__file__),
         'should ignore %s' % mock.__file__,
     )
コード例 #8
0
 def test_include_smiley(self):
     t = tracer.Tracer(None, include_packages=['smiley'])
     self.assertFalse(t._should_ignore_file(tracer.__file__))
コード例 #9
0
 def test_ignore_coverage_by_default(self):
     t = tracer.Tracer(None)
     self.assertTrue(t._should_ignore_file(coverage.__file__))
コード例 #10
0
 def test_ignore_smiley_by_default(self):
     t = tracer.Tracer(None)
     self.assertTrue(t._should_ignore_file(tracer.__file__))
コード例 #11
0
 def test_capture_stdlib(self):
     t = tracer.Tracer(None, include_stdlib=True)
     self.assertFalse(t._should_ignore_file(site.__file__))
コード例 #12
0
ファイル: test_tracer.py プロジェクト: religiose/smiley
 def test_ignore_stdlib(self):
     t = tracer.Tracer(None)
     self.assertTrue(t._should_ignore_file(atexit.__file__))