Replies: 2 comments
-
It's actually very hard if you want to be accurate. Since Regardless, this is a duplicate of #10130 which will be resolved via #11812. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Moved to #17180 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A lots of people discuss unit test path issue online. If one module import another module, it works on code runner, but unit test could NOT find it. if you make the unit test find it, and code runner no longer works. It is because the code runner run python file directly. Is it possible change the code runner from
to
This way will make both unit test and code runner work same time. So developer can organize their file in different folder easily.
here is an example:
as you can see, the first line use python relative path, so unit test can find module card. but if you run this module locally
We get ImportError. But if we can change code runner run the following command
Obviously, it works.
The hard part for this is,
❓How to determine the package path? But I don't think it is something very hard to do.
✔️😄We know current folder, we know the file path, simply remove current folder from the path, change all '/' to '.' and then remove the file extension.
Don't you think this is a good idea?
Beta Was this translation helpful? Give feedback.
All reactions