Fix broken test in lsst/alert_packet master

Description

python -m pytest .  does not succeed on the master branch of github.com/lsst/alert_packet, at least for me working locally. We should fix this.

The error I get is this:

======================== test session starts ========================= platform linux -- Python 3.8.2, pytest-5.4.3, py-1.8.1, pluggy-0.13.1 rootdir: /home/swnelson/code/rubin/alert_packet collected 6 items test/test_io.py . [ 16%] test/test_schema.py .. [ 50%] test/test_schemaRegistry.py . [ 66%] test/test_schemas.py F. [100%] ============================== FAILURES ============================== ______________ SchemaValidityTestCase.test_example_avro ______________ self = <test.test_schemas.SchemaValidityTestCase testMethod=test_example_avro> def test_example_avro(self): """Test that example data in Avro format can be loaded by the schema. """ no_data = ("1.0",) # No example data is available. bad_versions = ("2.0",) # This data is known not to parse. for version in self.registry.known_versions: path = path_to_sample_data(get_schema_root(), version, "fakeAlert.avro") schema = self.registry.get_by_version(version) if version in no_data: self.assertFalse(os.path.exists(path)) else: with open(path, "rb") as f: if version in bad_versions: with self.assertRaises(RuntimeError): schema.retrieve_alerts(f) else: retrieved_schema, alerts = schema.retrieve_alerts(f) > self.assertEqual(retrieved_schema, schema) E AssertionError: <lsst.alert.packet.schema.Schema object at 0x7f189cd8c940> != <lsst.alert.packet.schema.Schema object at 0x7f189cd14b50> test/test_schemas.py:77: AssertionError ====================== short test summary info ======================= FAILED test/test_schemas.py::SchemaValidityTestCase::test_example_avro ==================== 1 failed, 5 passed in 0.29s =====================

 

Checklist

Lucidchart Diagrams

Issue Matrix

hide

Activity

Show:
John Swinbank
July 7, 2020 at 10:53 PM

Looks good. Comments on GitHub; one trivial, one that I think does need action (but it's just taking out an __eq__). After that, good to merge.

I'm a bit sad that the broken test wasn't being caught in Jenkins, but I'm guessing that's because we're not running tests in Jenkins pending https://rubinobs.atlassian.net/browse/DM-25281#icft=DM-25281.

Done
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Reviewers

John Swinbank

Story Points

RubinTeam

Checklist

Created June 2, 2020 at 11:38 PM
Updated July 7, 2020 at 11:12 PM
Resolved July 7, 2020 at 11:12 PM