Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thanks for sharing your experience. In the project you're talking about, what role do automated (unit or integration) tests play? Was it part of your project policy to include tests for fixed bugs/new features? How did that change when you introduced mypy? What role do tests play today where you're using mypy widely now?


We also use unit and integration tests heavily, although neither test suite has enforced type checks. Some parts of the code have enforced unit and integration tests for changes, but others are things that are very difficult to unit test because they interact with systems outside of our control that don't document their low level API responses or have bugs/behaviors that we only observe when running integration tests against the real thing (and subsequently have to report issues or contribute fixes for).

We also use flake8, shellcheck, yamllint and black in our automated tests, as well as a couple of custom scripts (e.g. one that makes sure if you change the documentation you also remembered to regenerate and commit an updated index)

We also still write our tests to assume no type checking in parts dealing with external data, because we can still get badly typed data at runtime. But we also use valdation code to assert those types at the edges of the system so internal modules can assume types are correct.


Thanks




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: