Modify pytest configuration

Shift it from monkey/pytest.ini to pyproject.toml.
Add conftest.py in tests/ to add monkey directory to sys.path so test files recognize paths.
This commit is contained in:
Shreya 2021-04-19 17:31:01 +05:30
parent dc0e155c31
commit c37ae1e0ea
3 changed files with 15 additions and 7 deletions

View File

@ -1,7 +0,0 @@
[pytest]
log_cli = 1
log_cli_level = DEBUG
log_cli_format = %(asctime)s [%(levelname)s] %(module)s.%(funcName)s.%(lineno)d: %(message)s
log_cli_date_format=%H:%M:%S
addopts = -v --capture=sys --ignore=common/cloud/scoutsuite
norecursedirs = node_modules dist

5
monkey/tests/conftest.py Normal file
View File

@ -0,0 +1,5 @@
import sys
from pathlib import Path
MONKEY_BASE_PATH = str(Path(__file__).parent.parent)
sys.path.insert(0, MONKEY_BASE_PATH)

View File

@ -12,3 +12,13 @@ include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
[tool.pytest.ini_options]
minversion = "6.0"
log_cli = 1
log_cli_level = "DEBUG"
log_cli_format = "%(asctime)s [%(levelname)s] %(module)s.%(funcName)s.%(lineno)d: %(message)s"
log_cli_date_format = "%H:%M:%S"
addopts = "-v --capture=sys"
norecursedirs = "node_modules dist"
testpaths = "monkey/tests"