
import pytest

from cihai import exc


def test_base_exception():
    with pytest.raises(
        exc.CihaiException,
        message="Make sure no one removes or renames base CihaiException",
    ):
        raise exc.CihaiException()

    with pytest.raises(Exception, message="Extends python base exception"):
        raise exc.CihaiException()

import pytest

from cihai import exc


def test_base_exception():
    with pytest.raises(exc.CihaiException):
        raise exc.CihaiException()  # Make sure its base of CihaiException

    with pytest.raises(Exception):
        raise exc.CihaiException()  # Extends python base exception

Update exception test for pytest 5+
Update exception test for pytest 5+

pytest 3 had message for raises, this is removed in current versions.

- 
  import pytest
  
  from cihai import exc
  
  
  def test_base_exception():
+     with pytest.raises(exc.CihaiException):
+         raise exc.CihaiException()  # Make sure its base of CihaiException
-     with pytest.raises(
-         exc.CihaiException,
-         message="Make sure no one removes or renames base CihaiException",
-     ):
-         raise exc.CihaiException()
  
-     with pytest.raises(Exception, message="Extends python base exception"):
-         raise exc.CihaiException()
+     with pytest.raises(Exception):
+         raise exc.CihaiException()  # Extends python base exception
  
Update exception test for pytest 5+
## Code Before:

import pytest

from cihai import exc


def test_base_exception():
    with pytest.raises(
        exc.CihaiException,
        message="Make sure no one removes or renames base CihaiException",
    ):
        raise exc.CihaiException()

    with pytest.raises(Exception, message="Extends python base exception"):
        raise exc.CihaiException()

## Instruction:
Update exception test for pytest 5+
## Code After:
import pytest

from cihai import exc


def test_base_exception():
    with pytest.raises(exc.CihaiException):
        raise exc.CihaiException()  # Make sure its base of CihaiException

    with pytest.raises(Exception):
        raise exc.CihaiException()  # Extends python base exception
