Here's what I have now:
file:/tests/__init__.py
#!/usr/bin/python
# -*- coding: utf-8 -*'
import tests
import factories.testFactory
def setUpPackage():
tests.cls = factories.testFactory.getClass("black")
The simple way would be to just insert the declaration below imports but then I get some problems with the type of the variable since the getClass-function is a factory and returns a class.This code actually works but it "looks" wrong to me ; first import the package in which you are(tests) and then refer to yourself(tests.cls).
Is this the right way to do it ?
Is there another more dynamic way in which the code still works if it's moved to another directory ?
How about if I change the class name ?
Thanks in advance ..
ps. the setUpPackage is the function name that nose recognizes ..


Sign In
Create Account


Back to top









