-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpytest.ini
More file actions
37 lines (29 loc) · 2.13 KB
/
Copy pathpytest.ini
File metadata and controls
37 lines (29 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[pytest]
addopts = -p no:faulthandler --maxfail=2 --disable-warnings -v --html=reports/reports.html --selfcontained-html --show-capture='stdout' --tb=native
python_files = test_*.py
python_functions = test_*
log_cli = true
log_cli_level = INFO
log_cli_format = %(asctime)s [%(levelname)s] %(message)s
log_cli_date_format = %Y-%m-%d %H:%M:%S
filterwarnings =
error
ignore::UserWarning
ignore::DeprecationWarning
# addopts - add options
# -p no:faulthandler - FaultHandler is used for diagnosing crashes, debugs. (May be useful in developing and Testing)
# --html:reports/reports.html - Reports folder.
# --selfcontained-html: By default, pytest-html creates an HTML file along with an external CSS stylesheet and separate asset folders for styling and icons.
# When you pass --self-contained-html, it forces pytest-html to embed all CSS styles, JavaScript, and assets inline directly into a single HTML file using data URIs.
# --show-capture='stdout': Only show captured stdout in the failure traceback summaries.
# --tb=native : By default, Pytest formats Python exception tracebacks with color-coded, detailed line-by-line context (showing local variables, exact failing code blocks, etc.).
# Setting --tb=native forces Pytest to use Python’s standard library traceback format instead.
# Python Test Files will be - test_*.py
# Python Test Functions will be - test_*
# log_cli = true : Enable live logging to the console
# log_cli_level = INFO : Set the minimum log level to display (e.g., INFO, DEBUG, WARNING)
# log_cli_format = %(asctime)s [%(levelname)s] %(message)s -Format how logs appear in the terminal
# log_cli_date_format = %Y-%m-%d %H:%M:%S - Format the timestamp display
# filterwarnings = error: Turns all unhandled Python warnings into hard errors, causing tests that trigger them to fail.
# ignore::UserWarning: Overrides the error rule specifically for UserWarning instances, preventing them from failing your tests.
# ignore::DeprecationWarning: Overrides the error rule for DeprecationWarning instances (often raised by third-party packages using older features).