-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* pytest config and restructure * codecov
- Loading branch information
Showing
9 changed files
with
85 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,39 @@ | ||
"""Unit tests for esmf_regrid.""" | ||
"""Common testing infrastructure.""" | ||
|
||
import pathlib | ||
|
||
|
||
# Base directory of the test results. | ||
_RESULT_PATH = pathlib.Path(__file__).parent.resolve() / "results" | ||
|
||
|
||
def get_result_path(relative_path, unit=True): | ||
""" | ||
Form the absolute path to the results test file. | ||
Parameters | ||
---------- | ||
relative_path : str, path, iterable str/path | ||
The relative path to the target test file. | ||
unit : bool, optional | ||
Specify whether the `relative_path` is for a unit test. | ||
Default is True. | ||
Returns | ||
------- | ||
Path | ||
The absolute result path. | ||
""" | ||
if isinstance(relative_path, str): | ||
relative_path = pathlib.Path(relative_path) | ||
|
||
if not isinstance(relative_path, pathlib.PurePath): | ||
relative_path = pathlib.Path(*relative_path) | ||
|
||
if unit: | ||
relative_path = pathlib.Path("unit") / relative_path | ||
|
||
result = _RESULT_PATH / relative_path | ||
|
||
return result.resolve(strict=True) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Unit tests for esmf_regrid.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ exclude = ''' | |
| build | ||
| dist | ||
)/ | ||
| results | ||
) | ||
''' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters