DEV Community

Discussion on: A guide to testing flask applications using unittest!

Collapse
 
rogerperkins profile image
rogerperkins • Edited

I installed via: pip install flask-unittest, but when I try to import flask_unittest, it doesn't work, I think it's because the package name has a dash (-) in it instead of an underscore (_). Tried to import flask-unittest, the import statement doesn't seem to like dashes. Referring to the Pycharm messages by the way.

Collapse
 
totally_chase profile image
Phantz

The package name can be different than the module name. Generally, pip packages use dashes but python modules don't allow dashes in them. That said, you should be able to use the package with import flask_unittest. Make sure you're in the same environment where the package is installed.