41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
#!/usr/bin/env python3
|
|
"""Run retained CPU regressions without top-level Kit registration or GPU access.
|
|
|
|
This namespace mapping is test-only, never a runtime binding or physical gate.
|
|
Use the documented CPU interpreter; arguments are passed to pytest.
|
|
"""
|
|
|
|
import importlib.util
|
|
import os
|
|
from pathlib import Path
|
|
import sys
|
|
|
|
|
|
def main():
|
|
root = Path(__file__).resolve().parents[1]
|
|
os.chdir(root)
|
|
os.environ['CUDA_VISIBLE_DEVICES'] = ''
|
|
os.environ['PYTEST_DISABLE_PLUGIN_AUTOLOAD'] = '1'
|
|
os.environ['PYTHONDONTWRITEBYTECODE'] = '1'
|
|
sys.dont_write_bytecode = True
|
|
# Do not inherit opt-ins that turn otherwise skipped wrappers into Kit runs.
|
|
for name in ('SIM_RESIDUAL_RUNTIME_TESTS', 'SIM_RESIDUAL_LEARNING_API_TESTS',
|
|
'SKILLFACTORY_FD_PROBE'):
|
|
os.environ.pop(name, None)
|
|
|
|
package = root / 'source/SkillFactory/SkillFactory'
|
|
spec = importlib.util.spec_from_file_location(
|
|
'SkillFactory', package / '__init__.py',
|
|
submodule_search_locations=[str(package)])
|
|
sys.modules['SkillFactory'] = importlib.util.module_from_spec(spec)
|
|
sys.path.insert(0, str(root / 'scripts'))
|
|
|
|
import pytest
|
|
|
|
targets = sys.argv[1:] or [str(root / 'tests')]
|
|
return pytest.main(['-q', '-p', 'no:cacheprovider', *targets])
|
|
|
|
|
|
if __name__ == '__main__':
|
|
raise SystemExit(main())
|