-
Notifications
You must be signed in to change notification settings - Fork 117
Closed
Description
This is a recurring issue. If a user tests needs to import a custom module (e.g., other tests or user libraries), ReFrame will not automatically import those. The user has to set programmatically set the python path to allow reframe to load the modules. This happens only if the user tests reside outside the reframe installation prefix. Here is an example to reproduce:
dir/
├── user_imports.py
└── userlib
└──__init__.py
And the user_imports.py is the following:
import reframe as rfm
# Uncomment the following lines for the example to work.
# import os
# import sys
# sys.path.append(os.path.dirname(__file__))
from userlib import SYMBOL # noqa: F501
@rfm.simple_test
class echo_test(rfm.RunOnlyRegressionTest):
executable = 'echo hello'
valid_systems = ['*']
valid_prog_environs = ['*']
@sanity_function
def validate(self):
return TrueThe userlib module's contents are:
SYMBOL = 1Metadata
Metadata
Assignees
Type
Projects
Status
Done