Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion easybuild/tools/filetools.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import zlib
from functools import partial
from html.parser import HTMLParser
from pathlib import Path
import urllib.request as std_urllib

from easybuild.base import fancylogger
Expand Down Expand Up @@ -2777,7 +2778,7 @@ def copy(paths, target_path, force_in_dry_run=False, **kwargs):
:param force_in_dry_run: force running the command during dry run
:param kwargs: additional named arguments to pass down to copy_dir
"""
if isinstance(paths, str):
if isinstance(paths, (str, Path)):
paths = [paths]

_log.info("Copying %d files & directories to %s", len(paths), target_path)
Expand Down
10 changes: 10 additions & 0 deletions test/framework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,13 @@

@author: Toon Willems (Ghent University)
"""

from pathlib import Path
from easybuild.tools.filetools import read_file

TEST_DIR = Path(__file__).parent
REPO_ROOT = TEST_DIR.parent.parent
TEST_MODULES_DIR = TEST_DIR / 'modules'
TEST_ECS_DIR = TEST_DIR / 'easyconfigs' / 'test_ecs'
TOY_EC = TEST_ECS_DIR / 't' / 'toy' / 'toy-0.0.eb'
TOY_EC_TXT: str = read_file(TOY_EC)
181 changes: 63 additions & 118 deletions test/framework/easyblock.py

Large diffs are not rendered by default.

272 changes: 94 additions & 178 deletions test/framework/easyconfig.py

Large diffs are not rendered by default.

155 changes: 67 additions & 88 deletions test/framework/filetools.py

Large diffs are not rendered by default.

154 changes: 65 additions & 89 deletions test/framework/robot.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion test/framework/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import unittest
from contextlib import contextmanager
from importlib import reload
from pathlib import Path

from easybuild.base import fancylogger
from easybuild.base.testing import TestCase
Expand Down Expand Up @@ -316,7 +317,7 @@ def eb_main(self, args, do_build=False, return_error=False, return_exit_code=Fal

# always run main in unit testing mode (which for example allows for using deprecated toolchains);
# note: don't change 'args' value, which is passed by reference!
main_args = args + ['--unit-testing-mode']
main_args = [str(arg) if isinstance(arg, Path) else arg for arg in args] + ['--unit-testing-mode']

myerr = False
if logfile is None:
Expand Down