diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-03-21 17:20:23 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-03-22 07:04:13 -0400 |
commit | 66173dc24db5e6800483e0faddf583e80d9eb9b3 (patch) | |
tree | 290844e83b57e29f9ff20799fa0010978990bedb /tests/helpers.py | |
parent | e613a75b7c20bec00b4564f2d87812a8fd7b8e11 (diff) | |
download | python-coveragepy-git-66173dc24db5e6800483e0faddf583e80d9eb9b3.tar.gz |
refactor: nice_file can be used as a function
Diffstat (limited to 'tests/helpers.py')
-rw-r--r-- | tests/helpers.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/helpers.py b/tests/helpers.py index c916c8a2..262d9301 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -93,6 +93,12 @@ def make_file(filename, text="", bytes=b"", newline=None): return filename +def nice_file(*fparts): + """Canonicalize the file name composed of the parts in `fparts`.""" + fname = os.path.join(*fparts) + return os.path.normcase(os.path.abspath(os.path.realpath(fname))) + + class CheckUniqueFilenames(object): """Asserts the uniqueness of file names passed to a function.""" def __init__(self, wrapped): |