microsoft/qdk
Publicmirrored fromhttps://github.com/microsoft/qdkAvailable
source/qdk_package/tests/conftest.py
17lines · modecode
| 1 | # Copyright (c) Microsoft Corporation. |
| 2 | # Licensed under the MIT License. |
| 3 | |
| 4 | import sys |
| 5 | from pathlib import Path |
| 6 | |
| 7 | # Add local 'src' so 'qdk' can be imported without installation and add tests dir so 'mocks' is importable. |
| 8 | _root = Path(__file__).resolve().parent |
| 9 | _src = _root.parent / "src" |
| 10 | for p in (_src, _root): |
| 11 | if str(p) not in sys.path: |
| 12 | sys.path.insert(0, str(p)) |
| 13 | |
| 14 | # Ensure a qsharp stub (if real package absent) via centralized mocks helper. |
| 15 | import mocks |
| 16 | |
| 17 | mocks.mock_qsharp() |
| 18 | |