Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Goulding authored and jenshnielsen committed Sep 27, 2022
1 parent 4a8b304 commit ef752b6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions qcodes/tests/test_instrument.py
Expand Up @@ -428,12 +428,12 @@ def test_snapshot_and_meta_attrs():


class TestSnapshotType(Metadatable):
def __init__(self, sample_value : int) -> None:
def __init__(self, sample_value: int) -> None:
super().__init__()
self.sample_value = sample_value

def snapshot_base(self, update = True, params_to_skip_update = None):
return { 'sample_key': self.sample_value }
def snapshot_base(self, update=True, params_to_skip_update=None):
return {"sample_key": self.sample_value}


class TestInstrument(InstrumentBase):
Expand All @@ -451,21 +451,21 @@ def test_snapshot_and_meta_attrs2():
"""Test snapshot of child of InstrumentBase which contains _meta_attrs attribute that is itself Metadatable"""
instr = TestInstrument("instr", label="Label")

assert instr.name == 'instr'
assert instr.name == "instr"

assert hasattr(instr, "_meta_attrs")
assert instr._meta_attrs == ["name", "label", "test_attribute"]

snapshot = instr.snapshot()

assert 'name' in snapshot
assert 'instr' == snapshot['name']
assert "name" in snapshot
assert "instr" == snapshot['name']

assert "label" in snapshot
assert "Label" == snapshot["label"]

assert '__class__' in snapshot
assert 'TestInstrument' in snapshot['__class__']
assert "__class__" in snapshot
assert "TestInstrument" in snapshot["__class__"]

assert 'test_attribute' in snapshot
assert {'sample_key': 12} == snapshot["test_attribute"]
assert "test_attribute" in snapshot
assert {"sample_key": 12} == snapshot["test_attribute"]

0 comments on commit ef752b6

Please sign in to comment.