Skip to content

Commit

Permalink
pytest: Preparing to run integration tests using pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
cdecker committed Mar 29, 2019
1 parent 2ec37ee commit 993d0ee
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__
18 changes: 18 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
addopts=-p no:logging

0 comments on commit 993d0ee

Please sign in to comment.