sparklearner233
New Contributor II

Try this:

import unittest
import os
 
# Set the path to the directory containing the test file
test_dir = '/dbfs/mnt/repository/yunjchen/customer_ai_project/packages/visualization/test/model_performance'
 
# Add the test directory to the Python path
os.sys.path.append(test_dir)
 
# Import the test module
import test_ranking

all_tests = unittest.TestLoader().loadTestsFromModule(test_ranking)
# run all tests with verbosity
test_runner = unittest.TextTestRunner(verbosity=2)

assert test_runner.run(all_tests).wasSuccessful(), 'Test failed; see logs above'