Skip to content

Python Unittest not finding functions #119772

Discussion options

You must be logged in to vote

It seems like you're facing a peculiar problem where despite importing the unittest module in Python, you're unable to access or use its functions and classes. Let's try to troubleshoot this issue step by step:

  1. Verify Import: Ensure you are importing the unittest module correctly. Your script should start with:

    import unittest
  2. Check for Name Conflicts: Make sure there is no file or directory in your project or Python's path named unittest.py or a folder named unittest that could be shadowing the standard library's unittest module. Python might be importing that file or folder instead of the actual module from the standard library. You can check the file path of the imported module with:

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kalebers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Programming Help Programming languages, open source, and software development.
2 participants