0

I am used to mocking most boto3 functionalities with moto.

Recently, I encountered awswrangler to query athena and get the result as a nice pandas dataframe.

wondering if there is a way to mock the functionality?

tandem
  • 2,040
  • 4
  • 25
  • 52

1 Answers1

0

you can use from moto import mock_athena

from moto import mock_athena

class Test:
    @mock_athena
    def test_athena(self):
         pass


#OR you can use this ,this is more useful
class Test(unittest.TestCase):


    athena_service = mock_athena()

    def setUp(self):
    athena_service.start()

    def tearDown(self):
        athena_service.stop()

    def test(self):
        client = boto3.client('athena')
        #whatever you want to test in athena