Skip to content

Commit

Permalink
Updated the test_pulsar.py
Browse files Browse the repository at this point in the history
  • Loading branch information
vhaasteren committed Nov 9, 2023
1 parent 4b94571 commit 87813ee
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions tests/test_pulsar.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ def setUpClass(cls):
cls.psr = Pulsar(
datadir + "/B1855+09_NANOGrav_9yv1.gls.par", datadir + "/B1855+09_NANOGrav_9yv1.tim", drop_t2pulsar=True
)
cls.psr_nodrop = Pulsar(
datadir + "/B1855+09_NANOGrav_9yv1.gls.par", datadir + "/B1855+09_NANOGrav_9yv1.tim", drop_t2pulsar=False
)

@classmethod
def tearDownClass(cls):
shutil.rmtree("pickle_dir", ignore_errors=True)

def test_droppsr(self):
self.psr_nodrop = Pulsar(
datadir + "/B1855+09_NANOGrav_9yv1.gls.par", datadir + "/B1855+09_NANOGrav_9yv1.tim", drop_t2pulsar=False
)

self.psr_nodrop.drop_tempopsr()

with self.assertRaises(AttributeError):
Expand Down Expand Up @@ -232,15 +233,15 @@ def setUpClass(cls):
timing_package="pint",
)

cls.psr_nodrop = Pulsar(
def test_droppsr(self):
self.psr_nodrop = Pulsar(
datadir + "/B1855+09_NANOGrav_9yv1.gls.par",
datadir + "/B1855+09_NANOGrav_9yv1.tim",
ephem="DE430",
drop_pintpsr=False,
timing_package="pint",
)

def test_droppsr(self):
self.psr_nodrop.drop_pintpsr()

with self.assertRaises(AttributeError):
Expand All @@ -256,6 +257,14 @@ def test_droppsr(self):
_ = self.psr_nodrop.timfile

def test_drop_not_picklable(self):
self.psr_nodrop = Pulsar(
datadir + "/B1855+09_NANOGrav_9yv1.gls.par",
datadir + "/B1855+09_NANOGrav_9yv1.tim",
ephem="DE430",
drop_pintpsr=False,
timing_package="pint",
)

self.psr_nodrop.drop_not_picklable()

with self.assertRaises(AttributeError):
Expand Down

0 comments on commit 87813ee

Please sign in to comment.