kevinjqliu commented on code in PR #3206:
URL: https://github.com/apache/iceberg-python/pull/3206#discussion_r3295006759


##########
tests/cli/test_console.py:
##########
@@ -69,10 +69,28 @@ def test_version_does_not_load_catalog(mocker: MockFixture) 
-> None:
     result = runner.invoke(run, ["version"])
 
     assert result.exit_code == 0
-    assert result.output == f"{__version__}\n"
+    assert result.stdout == f"{__version__}\n"
     mock_load_catalog.assert_not_called()
 
 
+def test_version_flag() -> None:
+    runner = CliRunner()
+    result = runner.invoke(run, ["--version"])
+
+    assert result.exit_code == 0
+    assert result.output == f"{__version__}\n"
+
+
+def test_version_command_emits_deprecation_warning() -> None:
+    runner = CliRunner()
+    result = runner.invoke(run, ["version"])
+
+    assert result.exit_code == 0
+    assert __version__ in result.output
+    assert "deprecated" in result.output.lower()
+    assert "pyiceberg --version" in result.output

Review Comment:
   ```suggestion
       assert result.stdout == f"{__version__}\n"
       assert "deprecated" in result.stderr.lower()
       assert "pyiceberg --version" in result.stderr
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to