tophat / syrupy

:pancakes: The sweeter pytest snapshot plugin
https://tophat.github.io/syrupy
Apache License 2.0
501 stars 33 forks source link

fix: hide empty snapshot report #768

Closed iamogbz closed 1 year ago

iamogbz commented 1 year ago

Description

Waits until there's a report to be printed before adding to the terminal output

Related Issues

Checklist

Additional Comments

Manual testing 👇🏾

After

$ inv test -t 'notestsmatchesthis'
================================================================================== test session starts ==================================================================================
platform linux -- Python 3.11.4, pytest-7.4.0, pluggy-1.0.0
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /workspaces/syrupy
configfile: pyproject.toml
plugins: syrupy-4.0.4, xdist-3.3.1, benchmark-4.0.0
collected 250 items / 250 deselected / 0 selected                                                                                                                                       

================================================================================ 250 deselected in 0.20s ================================================================================
$ inv test -t 'json'
================================================================================== test session starts ==================================================================================
platform linux -- Python 3.11.4, pytest-7.4.0, pluggy-1.0.0
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /workspaces/syrupy
configfile: pyproject.toml
plugins: syrupy-4.0.4, xdist-3.3.1, benchmark-4.0.0
collected 250 items / 184 deselected / 66 selected                                                                                                                                      

tests/syrupy/extensions/json/test_json_filters.py ......                                                                                                                          [  9%]
tests/syrupy/extensions/json/test_json_matchers.py .                                                                                                                              [ 10%]
tests/syrupy/extensions/json/test_json_serializer.py ...........................................................                                                                  [100%]

-------------------------------------------------------------------------------- snapshot report summary --------------------------------------------------------------------------------
79 snapshots passed.
========================================================================== 66 passed, 184 deselected in 0.36s ===========================================================================

Before

$ inv test -t 'notestsmatchesthis'
================================================================================== test session starts ==================================================================================
platform linux -- Python 3.11.4, pytest-7.4.0, pluggy-1.0.0
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /workspaces/syrupy
configfile: pyproject.toml
plugins: syrupy-4.0.4, xdist-3.3.1, benchmark-4.0.0
collected 250 items / 250 deselected / 0 selected                                                                                                                                       

-------------------------------------------------------------------------------- snapshot report summary --------------------------------------------------------------------------------

================================================================================ 250 deselected in 0.19s ================================================================================
tophat-opensource-bot commented 1 year ago

:tada: This PR is included in version 4.0.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket: