-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconftest.py
More file actions
23 lines (19 loc) · 864 Bytes
/
conftest.py
File metadata and controls
23 lines (19 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from anypytools.pytest_plugin import AnyTestFile
import re
# import debugpy
# debugpy.listen(5679)
# print("Waiting for debugger attach")
# debugpy.wait_for_client()
MAIN_REGEX = re.compile(r"Main\s*=\s*{")
def pytest_collect_file(file_path, parent):
""" Add hook to collect Snippets files for testing"""
if file_path.suffix == ".any" and file_path.name != "libdef.any":
if "Snippet" in file_path.parts[-3]:
return AnyTestFile.from_parent(parent, path=file_path)
if file_path.name.endswith("main.any"):
if "Snippet" in file_path.parts[-4]:
return AnyTestFile.from_parent(parent, path=file_path)
# if "Downloads" in file_path.parts[-2]:
# content = file_path.read_text()
# if MAIN_REGEX.search(content):
# return AnyTestFile.from_parent(parent, path=file_path)