First time here? Check out the FAQ!

Revision history  [back]

Testing structure problems?

NOTE: I first entered this question before I logged in. It didn't show up so I'm trying again after logging in. Sorry if there is duplication.

I am brand new to writing unit tests and thought I would give it a shot. But I've run against a problem and I suspect it is of my own making. Here is my project structure:

.
├── src
│   └── scanner
│       ├── __pycache__
│       └── cmd
│           └── __pycache__
└── tests
    └── unittests
        └── __pycache__

I have one simple test under unittests and it does a from scanner.cmd import CMD which works in code that resides under src. I do have src listed as the starting directory in debug/execute but when I run the simple test it says scanner isn't there.

I have pytest selected as the testing tool and it is installed OK. At least I can import pytest successfully in the python shell.

What am I not doing right?

Testing structure problems?

NOTE: I first entered this question before I logged in. It didn't show up so I'm trying again after logging in. Sorry if there is duplication.

I am brand new to writing unit tests and thought I would give it a shot. But I've run against a problem and I suspect it is of my own making. Here is my project structure:

.
├── src
│   └── scanner
│       ├── __pycache__
│       └── cmd
│           └── __pycache__
└── tests
    └── unittests
        └── __pycache__

I have one simple test under unittests and it does a from scanner.cmd import CMD which works in code that resides under src. I do have src listed as the starting directory in debug/execute but when I run the simple test it says scanner isn't there.

I have pytest selected as the testing tool and it is installed OK. At least I can import pytest successfully in the python shell.

What am I not doing right?