| 1 |
def pytest_report_header(config): |
| 2 |
import os |
| 3 |
import pathlib |
| 4 |
import platform |
| 5 |
import sys |
| 6 |
import time |
| 7 |
|
| 8 |
|
| 9 |
docutils_root = pathlib.Path(__file__).resolve().parents[1] / 'docutils' |
| 10 |
namespace = {} |
| 11 |
exec((docutils_root/'__init__.py').read_text(encoding='utf-8'), namespace) |
| 12 |
|
| 13 |
return '\n'.join(( |
| 14 |
'', |
| 15 |
f'Testing Docutils {namespace["__version__"]} ' |
| 16 |
f'with Python {sys.version.split()[0]} ' |
| 17 |
f'on {time.strftime("%Y-%m-%d at %H:%M:%S")}', |
| 18 |
f'OS: {platform.system()} {platform.release()} {platform.version()} ' |
| 19 |
f'({sys.platform}, {platform.platform()})', |
| 20 |
f'Working directory: {os.getcwd()}', |
| 21 |
f'Docutils package: {docutils_root}', |
| 22 |
'', |
| 23 |
)) |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
if __name__ == '__main__': |
| 28 |
print(pytest_report_header(None)) |