Skip to content

Commit 98590a7

Browse files
committed
Enable parse errors check to be suppressed from the command line
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40490
1 parent 911ca8c commit 98590a7

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

tests/runtests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ def buildTestSuite():
1111
return suite
1212

1313
def main():
14+
# the following is temporary while the unit tests for parse errors are
15+
# still in flux
16+
if '-p' in sys.argv: # suppress check for parse errors
17+
import test_parser
18+
test_parser.checkParseErrors = False
19+
1420
unittest.TextTestRunner().run(buildTestSuite())
1521

1622
if __name__ == "__main__":

tests/test_parser.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
print 'module ElementTree not found, skipping etree tests'
2525

2626
#Run the parse error checks
27-
#XXX - ideally want this to be a command line argument
2827
checkParseErrors = True
2928

3029
def parseTestcase(testString):
@@ -109,6 +108,13 @@ def buildTestSuite():
109108
return unittest.TestLoader().loadTestsFromTestCase(TestCase)
110109

111110
def main():
111+
# the following is temporary while the unit tests for parse errors are
112+
# still in flux
113+
if '-p' in sys.argv: # suppress check for parse errors
114+
sys.argv.remove('-p')
115+
global checkParseErrors
116+
checkParseErrors = False
117+
112118
buildTestSuite()
113119
unittest.main()
114120

0 commit comments

Comments
 (0)