Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions python/pyspark/streaming/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1322,11 +1322,16 @@ def search_kinesis_asl_assembly_jar():
"or 'build/mvn -Pkinesis-asl package' before running this test.")

sys.stderr.write("Running tests: %s \n" % (str(testcases)))
failed = False
for testcase in testcases:
sys.stderr.write("[Running %s]\n" % (testcase))
tests = unittest.TestLoader().loadTestsFromTestCase(testcase)
if xmlrunner:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unittest.main will call sys.exit after finishing tests, so we should not use it here.

unittest.main(tests, verbosity=3,
testRunner=xmlrunner.XMLTestRunner(output='target/test-reports'))
result = xmlrunner.XMLTestRunner(output='target/test-reports', verbosity=3).run(tests)
if not result.wasSuccessful():
failed = True
else:
unittest.TextTestRunner(verbosity=3).run(tests)
result = unittest.TextTestRunner(verbosity=3).run(tests)
if not result.wasSuccessful():
failed = True
sys.exit(failed)