I want to put condition in my yml file,if pytest run successfully then its deploy ,if unsuccessfully ,deploy stay

version: 2.1

orbs:

python: circleci/python@1.5.0

workflows:

build_test:

  jobs:

    - build_and_tests

    - test

    - hold:

         type: approval

         requires:

           - test

    - deploy:

         requires:

           - hold              

         filters:

            branches:

              only: circleci

jobs:

build_and_test:

docker:

  - image: 'circleci/python:latest'

steps:

   - checkout

   - python/install-packages:

      pkg-manager: poetry

   - run:    

      command: |

         poetry run pytest

   - store_test_results:

      path: test-results          

test:

docker:

   - image: 'circleci/python:latest'            

steps:

   - checkout  

deploy:

  docker:

   - image: 'circleci/python:latest'

         

  steps:

   - run: echo 'this is the final deploy step'