-
Notifications
You must be signed in to change notification settings - Fork 787
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
unittest -> pytest #2049
base: master
Are you sure you want to change the base?
unittest -> pytest #2049
Conversation
c767637
to
89d8396
Compare
The three remaining points that you pointed out can be explained by this: in the test_comms.py, we only have one instance of libpanda, and all the tests in that file share that one instance. since we are using multithreading, we have 6 tests in total for usbprotocol and only 4 runners, there is a high chance that while running one test, it got switched out to another one while the state of the switched out test remains (same libpanda). This explains why we need pytest-order (to ensure completion of one test before executing the next one). One failure instance of running without pytest-order is that while executing The same apply for this:
Since when we used to use unitttest -> send_usb is run first before the reset_tx so the safety tx hook is already defined from the send_usb test so you don't need to redefine it in reset_tx anymore (you can confirm this by disable running send_usb test) and run the reset _tx only and that test would fail. pytest doesn't follow that test execution order anymore and it might run the reset_tx first, so without the safety hook definition, then it wouldn't get any tx messages Happy to clarify more if that's not clear |
We either need to:
Ideally, we can do #2. |
resolve commaai/openpilot#32941