You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
488 B

  1. import pytest
  2. def test_lacking_copy_ctor():
  3. from pybind11_tests import lacking_copy_ctor
  4. with pytest.raises(RuntimeError) as excinfo:
  5. lacking_copy_ctor.get_one()
  6. assert "the object is non-copyable!" in str(excinfo.value)
  7. def test_lacking_move_ctor():
  8. from pybind11_tests import lacking_move_ctor
  9. with pytest.raises(RuntimeError) as excinfo:
  10. lacking_move_ctor.get_one()
  11. assert "the object is neither movable nor copyable!" in str(excinfo.value)