SaashaJoshi / piQture

piQture: A quantum machine learning library for image processing.
https://saashajoshi.github.io/piQture/
Apache License 2.0
13 stars 6 forks source link

Unit test for `qcnn` fails with update in Python version to 3.12 #102

Closed SaashaJoshi closed 1 month ago

SaashaJoshi commented 1 month ago

Python 3.12 doesn't accept the called_once_with() method.

https://github.com/SaashaJoshi/piQture/blob/17bd2e6eb68d2c8ca68dfd95240d5ce54ff84e16/tests/neural_networks/test_qcnn.py#L124-L129

Refer #50

SaashaJoshi commented 1 month ago

While mocking instantiation of any method or class, one must also specify the return value. This was missing from the earlier versions of the test_qcnn.py file.

Another important note, while mocking classes that are only instantiated, one needs to mock the __init__ method.