Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit testing with mocks #47

Open
WillGibson opened this issue Dec 2, 2024 · 1 comment
Open

Unit testing with mocks #47

WillGibson opened this issue Dec 2, 2024 · 1 comment

Comments

@WillGibson
Copy link

I just had an initial experiment with type-enforced and I'm running into errors like this from the unit tests...

E   TypeError: (Conduit.__init__): Type mismatch for typed variable `echo_fn`. Expected one of the following `[<class 'collections.abc.Callable'>]` but got `<class 'unittest.mock.MagicMock'>` instead.

Is there any guidance on how to use mocks in unit tests while using type-enforced?

@connor-makowski
Copy link
Owner

connor-makowski commented Dec 3, 2024

Hey @WillGibson,

Thanks for creating an issue. We do not currently have any guidance on using mocks in unit tests.

To help me help you, can you send over some simple example code so I can know exactly how you are using mocks for your unit tests?

Connor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants