Differences From Artifact [c33e5bdbba]:

To Artifact [6bf0e6292d]:


13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

43
44
45
import pluginconf

sys.path.insert(0, f"{os.path.dirname(__file__)}/.pyz.pyz")
#os.chdir(os.path.dirname(__file__))

@pytest.fixture
def init():
    print(pluginconf.module_base)
    pluginconf.module_base = ["config"]    # must be one of the .pyz-contained modules (should be a dir/submodule for real uses)
    pluginconf.plugin_base = ["inner"]     # relative, must declare __path__, can't be __main__.py

@pytest.fixture
def pmd():
    return pluginconf.plugin_meta(module="inner")

def importy(init):
    import inner as pyz_inner
    #print(pyz_inner.__file__)

def module_list(init):
    assert set(pluginconf.module_list()) & {'__main__', 'config', 'inner'}

def inner_props(pmd):
    assert pmd["type"] == "pyz"
    assert pmd["category"] == "complex"
    assert pmd["title"] == "pyz module"
    assert pmd["config"][0]["name"] == "relation"
    assert pmd["state"] == "alpha"

#def tearDown():

#    pass#pluginconf.plugin_base = [".", "test", os.path.dirname(__file__), "."]
#    #pluginconf.module_base = "all_plugin_meta"
#    sys.path.pop(0)







|
|
|



















|
>



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import pluginconf

sys.path.insert(0, f"{os.path.dirname(__file__)}/.pyz.pyz")
#os.chdir(os.path.dirname(__file__))

@pytest.fixture
def init():
    print(pluginconf.plugin_base)
    pluginconf.data_root = ["config"]    # must be one of the .pyz-contained modules (should be a dir/submodule for real uses)
    pluginconf.plugin_base = ["inner"]   # relative, must declare __path__, can't be __main__.py

@pytest.fixture
def pmd():
    return pluginconf.plugin_meta(module="inner")

def importy(init):
    import inner as pyz_inner
    #print(pyz_inner.__file__)

def module_list(init):
    assert set(pluginconf.module_list()) & {'__main__', 'config', 'inner'}

def inner_props(pmd):
    assert pmd["type"] == "pyz"
    assert pmd["category"] == "complex"
    assert pmd["title"] == "pyz module"
    assert pmd["config"][0]["name"] == "relation"
    assert pmd["state"] == "alpha"

def tearDown(reset):
    pass
#    pass#pluginconf.plugin_base = [".", "test", os.path.dirname(__file__), "."]
#    #pluginconf.module_base = "all_plugin_meta"
#    sys.path.pop(0)