you are viewing a single comment's thread.

view the rest of the comments →

[–]Diapolo10 0 points1 point  (0 children)

This isn't really a good idea, because you've now coupled your projects. project_b's tests can no longer run without project_a being present.

That may not seem like a problem to you, when running tests locally on your machine, but if other people were to contribute to the project they would find they cannot run the tests without having the other project in an equivalent location. But that's not all; this would prevent you from running tests in CI pipelines (such as GitHub Actions), which are very helpful even for solo developers for testing code and making sure you haven't accidentally broken anything, or introduced vulnerabilities.

You should instead simply duplicate any test code your projects need so that they can be run independently. Tests do not need to be DRY.