Exemple #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'))
Exemple #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'))
Exemple #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')
Exemple #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")
Exemple #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')