def pytest_collection_finish(session):
    if session.config.option.my_test_dump is not None:
        for item in session.items:
            print('{}::{}'.format(item.fspath, item.name))
pytest.exit('Done!')
Pytest: Getting addresses of all tests