Add conftest.py for --diff/--accept pytest options
This commit is contained in:
parent
922ec123a9
commit
a3f8643c27
2 changed files with 19 additions and 0 deletions
17
tests/conftest.py
Normal file
17
tests/conftest.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import sys
|
||||
sys.path.insert(0, __file__.rsplit("/", 1)[0])
|
||||
|
||||
import golden
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption("--diff", action="store_true", help="Show diff for golden file mismatches")
|
||||
parser.addoption("--accept", action="store_true", help="Accept golden file changes")
|
||||
|
||||
|
||||
def pytest_sessionfinish(session):
|
||||
if golden._FAILED:
|
||||
if session.config.getoption("--accept"):
|
||||
golden._accept_actual(golden._FAILED)
|
||||
if session.config.getoption("--diff"):
|
||||
golden._show_differences(golden._FAILED)
|
||||
|
|
@ -332,6 +332,8 @@ Symbol table '.symtab' contains 17 entries:
|
|||
|
||||
No version information found in this file.
|
||||
|
||||
There is no GOT section in this file.
|
||||
|
||||
Displaying notes found in: .note.gnu.property
|
||||
Owner Data size Description
|
||||
GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue