def test_check_performance(capsys, casesdir): """checks whether the flag_performance stuff works""" sdsc.flag_performance = True path = "{}a-an.xml".format(casesdir) sdsc.checkOneFile(path) assert capsys.readouterr()[0].count("Running module") > 0 sdsc.flag_performance = False
def test_xml(xmltestcase): """Runs specified testcase and validates the output of all checks. The xmltestcase fixture returns all files in tests/cases""" nr_errors = 0 testname = os.path.basename(xmltestcase) try: resultxml = sdsc.checkOneFile(xmltestcase) except etree.Error as error: pytest.fail("Syntax error in testcase {0!r}: {1}!".format(testname, error.msg)) # Parse the input file and gather all ids inputids = gatherallids(xmltestcase) # Parse the result file and collect ids of errors and warnings complaints = parseresultfile(xmltestcase, resultxml) # Isolate unexpected warnings nr_errors += isolatewarnings(complaints) # Now check for missing errors and warnings searchforerrors(nr_errors, inputids, xmltestcase, complaints)
def test_checkpatterns(capsys, casesdir): """checks whether the patterns are sane""" sdsc.flag_checkpatterns = True path = "{}a-an.xml".format(casesdir) sdsc.checkOneFile(path) sdsc.flag_checkpatterns = False