コード例 #1
0
 def test_duplicates(self):
     """
     Hunt for duplicate functions in the .py files
     """
     root = U.bscr_root()
     rpt = ''
     for r, d, f in os.walk(root):
         pylist = [U.pj(r, x) for x in f if x.endswith(".py")]
         for filename in pylist:
             z = self.duplicate_check(filename)
             if z != '':
                 rpt += z
     if rpt != '':
         self.fail(rpt)
コード例 #2
0
 def test_0_pep8(self):
     """
     Check the code in this package for PEP8 conformance.
     """
     # pdb.set_trace()
     pep8 = pexpect.which('pep8')
     if pep8 is None:
         pytest.skip("Pep8 tool not found")
     else:
         root = U.bscr_root()
         for r, d, f in os.walk(root):
             pylist = [U.pj(r, x) for x in f if x.endswith(".py")]
             args = " ".join(pylist)
             if args != '':
                 cmd = "pep8 %s" % args
                 # print cmd
                 result = th.rm_cov_warn(pexpect.run(cmd))
                 self.assertEqual('', result,
                                  "Pep8 report: %s" % result)