File: test_path_info.py

package info (click to toggle)
python-friendly-traceback 0.7.62%2Bgit20240811.d7dbff6-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,264 kB
  • sloc: python: 21,500; makefile: 4
file content (18 lines) | stat: -rw-r--r-- 426 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pathlib
import pytest
import friendly_traceback as ft


class CustomPathLike:
    """A simple PEP 519 protocol impl, only for testing ``path_info`` functions."""

    def __fspath__(self):
        return __file__


@pytest.mark.parametrize(
    "file",
    [__file__, pathlib.Path(__file__), CustomPathLike()],
)
def test_is_excluded_file_accepts_any_pathlikes(file):
    assert not ft.path_info.is_excluded_file(file)