2

I have a sort of a "micro-service" Python repo with a setup similar to the following:

sample
├── bar
│   ├── src
│   │   └── main.py
│   └── tests
│       └── test_main.py
├── foo
│   ├── src
│   │   └── main.py
│   └── tests
│       └── test_main.py
└── shared
    ├── src
    │   └── main.py
    └── tests
        └── test_main.py

In vscode I only have the option of running all tests in foo,bar,shared or running individual test methods in the subfolders. What I want to do is be able to quickly run just the foo/tests/.

Is there some way I can configure pytest/Python to do this? I don't want to split each top level folder into its own workspace because I regularly jump back and for between them and don't want to have multiple windows per workspace open.

4

1 回答 1

-1

您应该能够pytest foo/tests/根据 pytest 文档在终端中运行该命令

于 2020-02-21T18:32:32.690 回答