with self.assertRaises(TypeError):
Symbol.fromsympy(sp_x*sp_x)
- def test_symbols(self):
- self.assertListEqual(list(symbols('x y')), [self.x, self.y])
- self.assertListEqual(list(symbols('x,y')), [self.x, self.y])
- self.assertListEqual(list(symbols(['x', 'y'])), [self.x, self.y])
-
class TestDummy(unittest.TestCase):
self.assertNotEqual(Dummy(), Dummy())
+class TestSymbols(unittest.TestCase):
+
+ def setUp(self):
+ self.x = Symbol('x')
+ self.y = Symbol('y')
+
+ def test(self):
+ self.assertListEqual(list(symbols('x y')), [self.x, self.y])
+ self.assertListEqual(list(symbols('x,y')), [self.x, self.y])
+ self.assertListEqual(list(symbols(['x', 'y'])), [self.x, self.y])
+ with self.assertRaises(TypeError):
+ symbols(1)
+ with self.assertRaises(TypeError):
+ symbols(['a', 1])
+
+
class TestRational(unittest.TestCase):
def setUp(self):