Closed kphlips closed 3 years ago
I implemented the ID checks, and it seems that they are now different objects with different PhysicsModules
. The modules are checked to have been prepared the same way through their string representations.
This is better. Now the two simulations are different.
However, they are very simple simulations, with only one PhysicsModule that doesn't have any complicated initialization logic.
If you want to really test this initialization logic, then you need to have a more complicated simulation. You should think about how to create a new test fixture with a simulation that checks that all of the modules have had their data shared before the initialize function is called.
I changed the structure of the test so that it now uses a more complicated physics module. I think this is in the right direction towards what you were asking for.
Yes, this is going in the right direction. Now you need to override the initialize
method in your AdvancedModule
class, so that it uses a shared resource from another module. This means that you also need to override inspect_resource
.
Does your code pass this new test?
Not anymore
Can you create a PR to add this new test? As you discovered, there is an important feature of the code that is not being correctly tested yet.
Pull Request
Description
Reduce complexity of
prepare_simulation
method and write test that confirms the result is equivalent to runningexchange_resources
andinitialize
separately.This pull request addresses # \ Fixes #
Checklist
The following items have been checked for this PR:
pylint
,flake8
, or similar)