Esempio n. 1
0
 def test_construction_from_string(self):
     result = CategoricalDtype.construct_from_string('category')
     assert is_dtype_equal(self.dtype, result)
     pytest.raises(
         TypeError, lambda: CategoricalDtype.construct_from_string('foo'))
Esempio n. 2
0
 def test_construction_from_string(self):
     result = CategoricalDtype.construct_from_string('category')
     assert is_dtype_equal(self.dtype, result)
     pytest.raises(TypeError,
                   lambda: CategoricalDtype.construct_from_string('foo'))
Esempio n. 3
0
 def test_construction_from_string(self):
     result = CategoricalDtype.construct_from_string('category')
     assert is_dtype_equal(self.dtype, result)
     msg = "cannot construct a CategoricalDtype"
     with pytest.raises(TypeError, match=msg):
         CategoricalDtype.construct_from_string('foo')
Esempio n. 4
0
 def test_construction_from_string(self):
     result = CategoricalDtype.construct_from_string("category")
     assert is_dtype_equal(self.dtype, result)
     msg = "Cannot construct a 'CategoricalDtype' from 'foo'"
     with pytest.raises(TypeError, match=msg):
         CategoricalDtype.construct_from_string("foo")
Esempio n. 5
0
 def test_construction_from_string(self):
     result = CategoricalDtype.construct_from_string('category')
     assert is_dtype_equal(self.dtype, result)
     msg = "cannot construct a CategoricalDtype"
     with pytest.raises(TypeError, match=msg):
         CategoricalDtype.construct_from_string('foo')