Skip to content

Commit

Permalink
Change: Avoid printing output to console in JS update_version tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernricks committed Oct 5, 2022
1 parent a4f193b commit cb90b85
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/version/test_javascript_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.


import contextlib
import io
import json
import unittest
from pathlib import Path
Expand Down Expand Up @@ -65,8 +67,9 @@ def test_update_version_file(self):
package_file.write_text(
'{"name":"foo", "version":"1.2.3"}', encoding="utf-8"
)
cmd = JavaScriptVersionCommand(project_file_path=package_file)
cmd.update_version("22.4.0.dev1")
with contextlib.redirect_stdout(io.StringIO()):
cmd = JavaScriptVersionCommand(project_file_path=package_file)
cmd.update_version("22.4.0.dev1")

with package_file.open(mode="r", encoding="utf-8") as fp:
fake_package = json.load(fp)
Expand Down

0 comments on commit cb90b85

Please sign in to comment.