Suppose I have a Repo A that imports a Repo B.  I maintain both of them.Currently, I have some convenience functions that are useful for testing of both repos.  They live in Repo B's test directory.  When you install Repo B, it includes it test directory so that Repo A has access to these convenience functions.Is this a reasonable software pattern?One alternative would be copy and pasting the convenience functions into Repo A and divorcing the test suites.
Should I share test code between different repositories
design patterns;unit testing;packages
Is it a pattern? No, this is called reuse. And it has nothing to do with the fact you have test code in mind.Is it reasonable? It depends, sometimes it is, sometimes not, key factor is how tight the life cycle of A and B is or should be coupled. Reuse avoids duplicate maintenance, but it comes fot the price of coupling A and B together.Is there a third alternative? Of course: refactoring of the convenience functions to a third, independent package C and using C from A and B. But is this better? It depends, same as above.