mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-22 23:54:20 +01:00
pytest: Preparing to run integration tests using pytest
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
__pycache__
|
||||||
18
conftest.py
Normal file
18
conftest.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
# This function is based upon the example of how to
|
||||||
|
# "[make] test result information available in fixtures" at:
|
||||||
|
# https://pytest.org/latest/example/simple.html#making-test-result-information-available-in-fixtures
|
||||||
|
# and:
|
||||||
|
# https://github.com/pytest-dev/pytest/issues/288
|
||||||
|
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
|
||||||
|
def pytest_runtest_makereport(item, call):
|
||||||
|
# execute all other hooks to obtain the report object
|
||||||
|
outcome = yield
|
||||||
|
rep = outcome.get_result()
|
||||||
|
|
||||||
|
# set a report attribute for each phase of a call, which can
|
||||||
|
# be "setup", "call", "teardown"
|
||||||
|
|
||||||
|
setattr(item, "rep_" + rep.when, rep)
|
||||||
2
pytest.ini
Normal file
2
pytest.ini
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[pytest]
|
||||||
|
addopts=-p no:logging
|
||||||
Reference in New Issue
Block a user