Add devshell command: "update_test_snapshots"

pull/85/head
JensDiemer 2022-01-01 14:13:11 +01:00
rodzic beb13019a6
commit 461ca12a74
1 zmienionych plików z 15 dodań i 0 usunięć

Wyświetl plik

@ -184,6 +184,21 @@ class PyInventoryCommandSet(DevShellBaseCommandSet):
print(f'updated: {po_file_path}')
def do_update_test_snapshots(self, statement: cmd2.Statement):
"""
Update all test snapshot files by run tests with RAISE_SNAPSHOT_ERRORS=0
"""
verbose_check_call(
'pytest',
*statement.arg_list,
cwd=self.config.base_path,
exit_on_error=True,
extra_env={
# https://github.com/boxine/bx_py_utils#notes-about-snapshot
'RAISE_SNAPSHOT_ERRORS': '0'
}
)
class DevShellCommandSet(OriginDevShellCommandSet):