Replies: 1 comment
-
It sounds like you're encountering a common issue with Python's module import system when organizing your project, especially when tests are in a subfolder. You're right, the goal is to keep your project organized with tests in their own folder while still being able to import modules from the root or other parts of your project. You can follow something like this my_project/ |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm a beginner and I haven't been able to figure this out. I work in an IDE (VsCode). For the scripts that are kept outside, that is, in the project's root folder; I have them there in the meantime, but I took a unit test which, is inside a folder to test an entire module, and it won't let me call it. The module is in the root folder and the test folder is inside the root folder with the test inside and the init.py to indicate that it's a package. I understand that, for example, I would have to move the test script to the root folder, but the idea is that I can save the test inside a folder and be able to call other modules from other folders without giving me an error, even more so if they are both inside the same root folder.
Beta Was this translation helpful? Give feedback.
All reactions