only use/import pytest if needed (by enable_training) (#5437)
only use/import pytest if needed (by enable_training) (#5437)

Co-authored-by: liqun <ebd212274156c51b5a3dfaa9138e6aa8d7cbc6b6@OrtTrainingDev4.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime