0

I have a class named ConfigInstantiator which has some logic in setup.py.

I want to test this class.

I assume that when setup.py is called, my package is not ready yet, so moving this class into one of the module of my package doesn't work. (Am I right?)

I tried to:

import setup

in unit test, but it conflicts with PyCharm's setup.py.

Do you know if there is a way to unittest this class?

user1633272
  • 2,007
  • 5
  • 25
  • 48

1 Answers1

0
  1. As @SmartManoj suggested, use technology suggested in How to import a module given the full path?
  2. Put setup function inside block:

    if __name__ == '__main__':
    
Arya McCarthy
  • 8,554
  • 4
  • 34
  • 56
user1633272
  • 2,007
  • 5
  • 25
  • 48