From 5a0f280e5a22a511a55419727a9fbb5cff41ea6c Mon Sep 17 00:00:00 2001 From: Steph Merritt Date: Tue, 26 Mar 2024 14:38:03 +0000 Subject: [PATCH] docstrings for test utility functions --- src/adler/utilities/tests_utilities.py | 28 ++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/adler/utilities/tests_utilities.py b/src/adler/utilities/tests_utilities.py index 92df937..6f4d76c 100644 --- a/src/adler/utilities/tests_utilities.py +++ b/src/adler/utilities/tests_utilities.py @@ -2,7 +2,16 @@ from pathlib import Path -def get_test_data_path(): +def get_test_data_path(): # pragma: no cover + """Gets the absolute path of the tests/data directory. + + Returns + ----------- + path_to_data : str + The absolute path to the tests/data directory. + + """ + # where is this file? path_to_file = os.path.abspath(__file__) @@ -12,7 +21,22 @@ def get_test_data_path(): return path_to_data -def get_test_data_filepath(filename): +def get_test_data_filepath(filename): # pragma: no cover + """Gets the absolute path of a supplied file in the tests/data directory. + + + Parameters + ----------- + filename : str + The filename of the desired test file. + + Returns + ----------- + str + The absolute path to the specified file in the tests/data directory. + + """ + filepath = get_test_data_path() return os.path.join(filepath, filename)