Something before run the test. Xdoctest need to set the `os.environ` according to the test capacity, which `+REQUIRES` used to match the test required environment. Legacy sample code processor do NOT need. Args: test_capacity(set): the test capacity, li
(self, test_capacity: set)
| 286 | return docstring |
| 287 | |
| 288 | def prepare(self, test_capacity: set) -> None: |
| 289 | """Something before run the test. |
| 290 | |
| 291 | Xdoctest need to set the `os.environ` according to the test capacity, |
| 292 | which `+REQUIRES` used to match the test required environment. |
| 293 | |
| 294 | Legacy sample code processor do NOT need. |
| 295 | |
| 296 | Args: |
| 297 | test_capacity(set): the test capacity, like `cpu`, `gpu` and so on. |
| 298 | """ |
| 299 | pass |
| 300 | |
| 301 | def run(self, api_name: str, docstring: str) -> list[TestResult]: |
| 302 | """Extract codeblocks from docstring, and run the test. |