Running unit tests from a different notebook (using Python unittest package) doesn't produce output (can't discover the test files)

FG
New Contributor II

I have a test file (test_transforms.py) which has a series of tests running using Python's unittest package. I can successfully run the tests inside of the file with expected output. But when I try to run this test file from a different notebook (run_unit_tests), it doesn't produce any test results ('Ran 0 tests in 0.000s').

I have tried to keep both files in the same dir but still doesn't work. Here's how the tests are being run:

# print(os.getcwd())

# print(os.listdir())

run_test = unittest.main(argv=[' '], verbosity=2, exit=False)

assert run_test.result.wasSuccessful(), 'Test failed; see logs above'

When run from a different notebook (run_unit_tests)

image.png 

When run from the test file (test_transforms.py)

imageNB: I have my notebooks and .py files in a repo. How can I succesfully run testfiles from a different notebook as my intent is to have these tests triggered with Github actions? (I have the workflow set up successfully)