Search code examples
flaskcircleciflake8circleci-2.0

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


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

Solution

  • 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.