my Python 3 code:
s3 = boto3.resource('s3')
s3bucket = s3.Bucket("cloud-orphans")
i'd like to test this code, which deletes from a bucket and copies to another. What is the best way to go about that with PyTest?
mock the action?
thanks for the reply. Do you have any resources I could look into mocking this? I am pretty new to Python testing.
can that be used inside PyTest?
Yep. There's a pytest-mock plugin that makes it easy as well.
is it good practice to use Unittest and PyTest interchangeably like this? I thought it was more like one or the other?
mock is very much independent of the rest of the unittest module.
Обсуждают сегодня