pitrou commented on code in PR #45549:
URL: https://github.com/apache/arrow/pull/45549#discussion_r1957954279


##########
python/pyarrow/tests/parquet/test_metadata.py:
##########
@@ -794,3 +794,28 @@ def 
test_column_chunk_key_value_metadata(parquet_test_datadir):
     assert key_value_metadata1 == {b'foo': b'bar', b'thisiskeywithoutvalue': 
b''}
     key_value_metadata2 = metadata.row_group(0).column(1).metadata
     assert key_value_metadata2 is None
+
+
+def test_internal_class_instantiation():
+    def msg(c):
+        return f"Can't instantiate internal class {c}"
+
+    with pytest.raises(TypeError) as excinfo:
+        pq.Statistics()
+        assert excinfo.value == msg("Statistics")

Review Comment:
   For the record, you could also use the `match` parameter. Though checking 
`excinfo.value` is fine as well.
   ```suggestion
       with pytest.raises(TypeError, match=msg("Statistics")) as excinfo:
           pq.Statistics()
   ```



-- 
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]

Reply via email to