Skip to content

Commit

Permalink
Fix deprecated attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Jul 12, 2024
1 parent 912929d commit f5359d9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions glue/viewers/common/tests/test_stretch_state_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,21 @@ def test_invalid_parameter(self):
self.state.stretch_parameters["foo"] = 1

def test_set_parameter(self):

pytest.importorskip('astropy', minversion='6.0')

self.state.stretch = "log"

assert self.state.stretch_object.exp == 1000
assert self.state.stretch_object.a == 1000

# Setting the stretch parameter 'exp' is synced with the stretch object attribute
self.state.stretch_parameters["exp"] = 200
assert self.state.stretch_object.exp == 200
self.state.stretch_parameters["a"] = 200
assert self.state.stretch_object.a == 200

# Changing stretch resets the stretch parameter dictionary
self.state.stretch = "linear"
assert len(self.state.stretch_parameters) == 0

# And there is no memory of previous parameters
self.state.stretch = "log"
assert self.state.stretch_object.exp == 1000
assert self.state.stretch_object.a == 1000

0 comments on commit f5359d9

Please sign in to comment.