reframe-hpc / reframe

A powerful Python framework for writing and running portable regression tests and benchmarks for HPC systems.
https://reframe-hpc.readthedocs.org
BSD 3-Clause "New" or "Revised" License
214 stars 101 forks source link

[feat] Support relative imports in tests #3110

Closed vkarak closed 7 months ago

vkarak commented 7 months ago

Relative imports in tests are currently supported only for tests inside the reframe's installation prefix. This is problematic for custom utilities and libraries that users may want to use in their tests.

To enable relative imports in tests loaded by reframe, the parent directory of the test must contain a __init__.py file.

I've updated the structure of the existing test library in the unit tests to expose the limitation of the current implementation and added a unit test that reproduces it.

Closes #3076.

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (f2a2326) 86.64% compared to head (0662303) 86.64%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #3110 +/- ## ======================================== Coverage 86.64% 86.64% ======================================== Files 61 61 Lines 12046 12051 +5 ======================================== + Hits 10437 10442 +5 Misses 1609 1609 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.