From 5680bee968d91239da27fff00aa33a9d891f4109 Mon Sep 17 00:00:00 2001 From: Emery Berger Date: Mon, 9 Dec 2024 05:01:00 -0500 Subject: [PATCH] Made path absolute to enable running pytest from a different directory. (#6567) --- conftest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index 3af072318..e9765962a 100644 --- a/conftest.py +++ b/conftest.py @@ -24,7 +24,9 @@ collect_ignore = [ *_py_files("tests/CrawlerRunner"), ] -with Path("tests/ignores.txt").open(encoding="utf-8") as reader: +base_dir = Path(__file__).parent +ignore_file_path = base_dir / "tests" / "ignores.txt" +with ignore_file_path.open(encoding="utf-8") as reader: for line in reader: file_path = line.strip() if file_path and file_path[0] != "#":