Skip to content

Commit

Permalink
FIX: removed dependence from top-level packages on the subpackage wit…
Browse files Browse the repository at this point in the history
…h tests (#103)

Authored-by: Daniel Zagaynov <kotopesutility@altlinux.org>
  • Loading branch information
kotopesutility committed Jul 30, 2023
1 parent e1fc6f2 commit 64f14ee
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion bimdp/__init__.py
Expand Up @@ -85,7 +85,6 @@
# the inspection stuff is considered a core functionality
from .inspection import *

from .test import test

from . import nodes
from . import hinet
Expand Down
7 changes: 4 additions & 3 deletions bimdp/test/__init__.py
@@ -1,11 +1,12 @@
import os
import mdp
from mdp.test import test as mdp_test

# wrap the mdp.test function and set the module path to bimdp path
infodict = mdp.NodeMetaclass._function_infodict(mdp.test)
# wrap the mdp.test.test function and set the module path to bimdp path
infodict = mdp.NodeMetaclass._function_infodict(mdp_test)
idx = infodict["argnames"].index('mod_loc')
defaults = list(infodict['defaults'])
defaults[idx] = os.path.dirname(__file__)
infodict['defaults'] = tuple(defaults)

test = mdp.NodeMetaclass._wrap_function(mdp.test, infodict)
test = mdp.NodeMetaclass._wrap_function(mdp_test, infodict)
1 change: 0 additions & 1 deletion mdp/__init__.py
Expand Up @@ -171,7 +171,6 @@ class MDPDeprecationWarning(DeprecationWarning, MDPWarning):
from . import nodes
from . import hinet
from . import parallel
from .test import test


# explicitly set __all__, mainly needed for epydoc
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Expand Up @@ -57,15 +57,15 @@ def get_long_description():

class MDPTest(_test):
def run_tests(self):
import mdp
import bimdp
from mdp.test import test as mtest
from bimdp.test import test as btest
# Fix random seed here, as we want reproducible failures in
# automatic builds using "python setup.py test"
# If the tests are run manually with pytest or
# using the mdp.test and bimdp.test functions, the seed
# is not set
errno = mdp.test(seed=725021957)
errno += bimdp.test(seed=725021957)
errno = mtest(seed=725021957)
errno += btest(seed=725021957)
sys.exit(errno)

def setup_package():
Expand Down

0 comments on commit 64f14ee

Please sign in to comment.