mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 02:51:31 +09:00
nixos/tests/test-driver: better control test env symbols
Previous to this commit, the entire test driver environment was shared with the actual python test environment. This is a hefty api surface. This commit selectively exposes only those symbols to the test environment that are actually meant to be used by tests.
This commit is contained in:
parent
5edf5b60c3
commit
db614e11d6
2 changed files with 45 additions and 16 deletions
|
@ -42,7 +42,9 @@ rec {
|
|||
python <<EOF
|
||||
from pydoc import importfile
|
||||
with open('driver-symbols', 'w') as fp:
|
||||
fp.write(','.join(dir(importfile('${testDriverScript}'))))
|
||||
t = importfile('${testDriverScript}')
|
||||
test_symbols = t._test_symbols()
|
||||
fp.write(','.join(test_symbols.keys()))
|
||||
EOF
|
||||
'';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue