Skip to content

Commit

Permalink
Fix a python 3.12 compatibility issue (#7450)
Browse files Browse the repository at this point in the history
  • Loading branch information
rvianello committed May 24, 2024
1 parent 930c7d6 commit b5041c3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Code/GraphMol/Wrap/rough_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8112,22 +8112,22 @@ def testIsRingFused(self):

def testNeedsHs(self):
m = Chem.MolFromSmiles("CO")
self.failUnless(Chem.NeedsHs(m))
self.assertTrue(Chem.NeedsHs(m))
mh = Chem.AddHs(m)
self.failIf(Chem.NeedsHs(mh))
self.assertFalse(Chem.NeedsHs(mh))
nm = Chem.RWMol(mh)
nm.RemoveAtom(3)
self.failUnless(Chem.NeedsHs(m))
self.assertTrue(Chem.NeedsHs(m))

def testCountAtomElec(self):
m = Chem.MolFromSmiles("c1n(C)ccc1")
self.failUnlessEqual(Chem.CountAtomElec(m.GetAtomWithIdx(0)),1)
self.failUnlessEqual(Chem.CountAtomElec(m.GetAtomWithIdx(1)),2)
self.assertEqual(Chem.CountAtomElec(m.GetAtomWithIdx(0)),1)
self.assertEqual(Chem.CountAtomElec(m.GetAtomWithIdx(1)),2)

def testAtomHasConjugatedBond(self):
m = Chem.MolFromSmiles("c1n(C)ccc1")
self.failUnless(Chem.AtomHasConjugatedBond(m.GetAtomWithIdx(1)))
self.failIf(Chem.AtomHasConjugatedBond(m.GetAtomWithIdx(2)))
self.assertTrue(Chem.AtomHasConjugatedBond(m.GetAtomWithIdx(1)))
self.assertFalse(Chem.AtomHasConjugatedBond(m.GetAtomWithIdx(2)))



Expand Down

0 comments on commit b5041c3

Please sign in to comment.