python -m <path/to/test/directory/>.<name_of_test_file>
Given the following directory structure:
└── test
├── __init__.py
├── foo.py
└── bar.py
You can execute the tests in each file like so:
python -m test.foo
python -m test.bar
This requires the code to use:
if __name__ == '__main__':
unittest.main()
See also: https://realpython.com/python-testing/#executing-your-first-test