0

My coworkers are trying to write unit test code and test API by using Circleci2.0 and Flake8. But I don't understand how I should write test code because this line pytest --flake8 in the below code does not mean.

What does this code in .cicleci/config.yml mean ?

Do we need to write test code in another xx.py file and execute this .py file like pytest xx.py?

If we should, does this line pytest --flake8 mean execution of xx.py file in another directly or the same directly even though this code dose not mention file path which execute test code file ?

  - run:
          name: Flake8 Check
          command: |
            . venv/bin/activate
            pytest --flake8
4

1 回答 1

0

You don't need to specify a filename. To quote the Pytest docs:

By default, pytest will run all files of the form test_*.py or *_test.py in the current directory and its subdirectories. More generally, it follows standard test discovery rules.

于 2018-05-21T18:53:39.127 回答