Skip to content

Conversation

@vkarak
Copy link
Contributor

@vkarak vkarak commented Feb 28, 2023

This PR introduces three changes:

  1. The directory of a test is temporarily added to sys.path during loading of the test. This allows to directly import modules defined below the test directory.
  2. The loader changes its working directory temporarily to the test's directory while loading.
  3. Two utility functions are added to simplify loading of user modules.

(2) and (3) allow users to import modules with a single call to the library function (see tutorial example).

Closes #2595.

@vkarak vkarak force-pushed the feat/userlib-imports branch from 2298e83 to 9f68f5a Compare March 2, 2023 19:57
@codecov-commenter
Copy link

codecov-commenter commented Mar 2, 2023

Codecov Report

❗ No coverage uploaded for pull request base (develop@b992afd). Click here to learn what that means.
Patch coverage: 94.28% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #2801   +/-   ##
==========================================
  Coverage           ?   86.80%           
==========================================
  Files              ?       60           
  Lines              ?    11395           
  Branches           ?        0           
==========================================
  Hits               ?     9891           
  Misses             ?     1504           
  Partials           ?        0           
Impacted Files Coverage Δ
reframe/frontend/loader.py 94.87% <89.47%> (ø)
reframe/utility/__init__.py 93.39% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@vkarak vkarak merged commit e527403 into reframe-hpc:develop Mar 13, 2023
@vkarak vkarak deleted the feat/userlib-imports branch March 13, 2023 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Better support custom imports from user tests

3 participants