File: test_all_docs.py

package info (click to toggle)
ormar 0.21.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,856 kB
  • sloc: python: 23,666; makefile: 34; sh: 14
file content (20 lines) | stat: -rw-r--r-- 518 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import subprocess
import sys
from pathlib import Path

import pytest

filepaths = []
path = Path(__file__).parent
for p in path.rglob("*"):
    print(p.name)
for p in path.rglob("*"):
    if p.name.endswith(".py") and not p.name == "__init__.py" and p != Path(__file__):
        filepath_ = str(p.resolve())
        filepaths.append(filepath_)


@pytest.mark.parametrize("filepath", filepaths)
def test_all_docs(filepath: str):
    result = subprocess.run([sys.executable, filepath])
    assert result.returncode == 0