Skip to content

Commit

Permalink
Force psf candidate state before testing stringification
Browse files Browse the repository at this point in the history
Other tests running could change this state and break the test.
  • Loading branch information
timj committed Nov 22, 2023
1 parent 8588faa commit 3639fac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_psfCandidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,13 @@ def testFaintNeighborMasking(self):

def testStr(self):
candidate = self.createCandidate()

# The setX methods are class globals and could contain values set
# by other code. Force the values here to ensure test consistency.
candidate.setChi2(2.0)
candidate.setWidth(0)
candidate.setHeight(0)

expect = "center=(123.0,45.0), status=UNKNOWN, rating=1.0, size=(0, 0), chi2=2.0, amplitude=0.0"
self.assertEqual(str(candidate), expect)

Expand Down

0 comments on commit 3639fac

Please sign in to comment.