Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problematic tests #1660

Open
ThomasWaldmann opened this issue Apr 4, 2024 · 2 comments
Open

problematic tests #1660

ThomasWaldmann opened this issue Apr 4, 2024 · 2 comments
Milestone

Comments

@ThomasWaldmann
Copy link
Member

When running tests locally on my machine using tox, I get quite some failures:


======================================================================= ERRORS ========================================================================
___________________________________________________ ERROR at setup of TestSiteCrawl.test_home_page ____________________________________________________

request = <SubRequest 'crawl_results' for <Function test_home_page>>
artifact_dir = PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/cli')

    @pytest.fixture(scope="package")
    def crawl_results(request, artifact_dir) -> List[CrawlResult]:
        _, artifact_base_dir = get_dirs('')
        crawl_success = True
        if settings.DO_CRAWL:
>           crawl_success = request.getfixturevalue('do_crawl')

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/conftest.py:200: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

request = <SubRequest 'do_crawl' for <Function test_home_page>>
artifact_dir = PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/cli')

    @pytest.fixture(scope="package")
    def do_crawl(request, artifact_dir):
        moin_dir, artifact_base_dir = get_dirs('')
        # initialize output files
        with open(get_crawl_log_path(), 'w'):
            pass
        with open(get_crawl_csv_path(), 'w'):
            pass
        server_started = True
        crawl_success = True
        if settings.SITE_HOST == '127.0.0.1:9080':
            server_started = request.getfixturevalue('server')
            if not server_started:
                crawl_success = False
        if server_started:
            logging.info('starting crawl')
>           os.chdir(moin_dir / 'src' / 'moin' / 'cli' / '_tests' / 'scrapy')
E           FileNotFoundError: [Errno 2] No such file or directory: '/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/scrapy'

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/conftest.py:175: FileNotFoundError
----------------------------------------------------------------- Captured log setup ------------------------------------------------------------------
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'run', '-p', '9080']
INFO     moin.cli._tests.conftest:conftest.py:174 starting crawl
______________________________________________________ ERROR at setup of TestSiteCrawl.test_200 _______________________________________________________

request = <SubRequest 'crawl_results' for <Function test_home_page>>
artifact_dir = PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/cli')

    @pytest.fixture(scope="package")
    def crawl_results(request, artifact_dir) -> List[CrawlResult]:
        _, artifact_base_dir = get_dirs('')
        crawl_success = True
        if settings.DO_CRAWL:
>           crawl_success = request.getfixturevalue('do_crawl')

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/conftest.py:200: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

request = <SubRequest 'do_crawl' for <Function test_home_page>>
artifact_dir = PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/cli')

    @pytest.fixture(scope="package")
    def do_crawl(request, artifact_dir):
        moin_dir, artifact_base_dir = get_dirs('')
        # initialize output files
        with open(get_crawl_log_path(), 'w'):
            pass
        with open(get_crawl_csv_path(), 'w'):
            pass
        server_started = True
        crawl_success = True
        if settings.SITE_HOST == '127.0.0.1:9080':
            server_started = request.getfixturevalue('server')
            if not server_started:
                crawl_success = False
        if server_started:
            logging.info('starting crawl')
>           os.chdir(moin_dir / 'src' / 'moin' / 'cli' / '_tests' / 'scrapy')
E           FileNotFoundError: [Errno 2] No such file or directory: '/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/scrapy'

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/conftest.py:175: FileNotFoundError
_________________________________________________ ERROR at setup of TestSiteCrawl.test_valid_request __________________________________________________

request = <SubRequest 'crawl_results' for <Function test_home_page>>
artifact_dir = PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/cli')

    @pytest.fixture(scope="package")
    def crawl_results(request, artifact_dir) -> List[CrawlResult]:
        _, artifact_base_dir = get_dirs('')
        crawl_success = True
        if settings.DO_CRAWL:
>           crawl_success = request.getfixturevalue('do_crawl')

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/conftest.py:200: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

request = <SubRequest 'do_crawl' for <Function test_home_page>>
artifact_dir = PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/cli')

    @pytest.fixture(scope="package")
    def do_crawl(request, artifact_dir):
        moin_dir, artifact_base_dir = get_dirs('')
        # initialize output files
        with open(get_crawl_log_path(), 'w'):
            pass
        with open(get_crawl_csv_path(), 'w'):
            pass
        server_started = True
        crawl_success = True
        if settings.SITE_HOST == '127.0.0.1:9080':
            server_started = request.getfixturevalue('server')
            if not server_started:
                crawl_success = False
        if server_started:
            logging.info('starting crawl')
>           os.chdir(moin_dir / 'src' / 'moin' / 'cli' / '_tests' / 'scrapy')
E           FileNotFoundError: [Errno 2] No such file or directory: '/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/scrapy'

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/conftest.py:175: FileNotFoundError
___________________________________________________ ERROR at setup of TestSiteCrawl.test_server_log ___________________________________________________

request = <SubRequest 'crawl_results' for <Function test_home_page>>
artifact_dir = PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/cli')

    @pytest.fixture(scope="package")
    def crawl_results(request, artifact_dir) -> List[CrawlResult]:
        _, artifact_base_dir = get_dirs('')
        crawl_success = True
        if settings.DO_CRAWL:
>           crawl_success = request.getfixturevalue('do_crawl')

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/conftest.py:200: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

request = <SubRequest 'do_crawl' for <Function test_home_page>>
artifact_dir = PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/cli')

    @pytest.fixture(scope="package")
    def do_crawl(request, artifact_dir):
        moin_dir, artifact_base_dir = get_dirs('')
        # initialize output files
        with open(get_crawl_log_path(), 'w'):
            pass
        with open(get_crawl_csv_path(), 'w'):
            pass
        server_started = True
        crawl_success = True
        if settings.SITE_HOST == '127.0.0.1:9080':
            server_started = request.getfixturevalue('server')
            if not server_started:
                crawl_success = False
        if server_started:
            logging.info('starting crawl')
>           os.chdir(moin_dir / 'src' / 'moin' / 'cli' / '_tests' / 'scrapy')
E           FileNotFoundError: [Errno 2] No such file or directory: '/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/scrapy'

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/conftest.py:175: FileNotFoundError
====================================================================== FAILURES =======================================================================
___________________________________________________________________ test_dump_help ____________________________________________________________________

load_help = (CompletedProcess(args=['moin', 'load-help', '-n', 'help-common'], returncode=0, stdout=b'Item loaded: logo.svg\nItem ...cessfully with 30 items\n', stderr=b'2024-04-04 20:19:26,661 INFO moin.cli.maint.modify_item:166 Load help started\n'))

    def test_dump_help(load_help):
        moin_dir, artifact_dir = get_dirs('cli')
        help_dir = Path('my_help')
        source_help_dir = moin_dir / 'src' / 'moin' / 'help'
>       with open(source_help_dir / 'help-en' / 'Home.data', newline='') as f:
E       FileNotFoundError: [Errno 2] No such file or directory: '/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/help/help-en/Home.data'

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/test_modify_item.py:43: FileNotFoundError
____________________________________________________________________ test_item_get ____________________________________________________________________

load_help = (CompletedProcess(args=['moin', 'load-help', '-n', 'help-common'], returncode=0, stdout=b'Item loaded: logo.svg\nItem ...cessfully with 30 items\n', stderr=b'2024-04-04 20:19:26,661 INFO moin.cli.maint.modify_item:166 Load help started\n'))

    def test_item_get(load_help):
        """extract an item from help and validate data and meta match original files in moin/help"""
        item_get = run(['moin', 'item-get', '-n', 'help-common/cat.jpg', '-m', 'cat.meta', '-d', 'cat.data'])
        assert_p_succcess(item_get)
        assert Path('cat.data').exists()
        assert Path('cat.meta').exists()
        moin_dir, _ = get_dirs('cli')
        with open('cat.meta') as f:
            meta_cat = json.load(f)
>       with open(moin_dir / 'src' / 'moin' / 'help' / 'help-common' / 'cat.jpg.meta') as f:
E       FileNotFoundError: [Errno 2] No such file or directory: '/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/help/help-common/cat.jpg.meta'

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/test_modify_item.py:78: FileNotFoundError
------------------------------------------------------------------ Captured log call ------------------------------------------------------------------
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'item-get', '-n', 'help-common/cat.jpg', '-m', 'cat.meta', '-d', 'cat.data']
____________________________________________________________________ test_item_put ____________________________________________________________________

index_create2 = CompletedProcess(args=['moin', 'index-create'], returncode=0, stdout=b'', stderr=b'2024-04-04 20:19:32,458 INFO moin.cli.maint.index:51 Index creation started\n2024-04-04 20:19:32,461 INFO moin.cli.maint.index:55 Index creation finished\n')

    def test_item_put(index_create2):
        """validate ability to add a new item to the wiki via item-put and extract using item-get
    
        include an item with non-ascii characters in name, tags and summary
    
        check for ability to handle non-ascii characters in index-dump"""
        for page in ['Home', 'help-common/Home', 'MyRussianPage']:
            page_filename = page.replace('/', '-')
            item_get_fail = run(['moin', 'item-get', '-n', page, '-m', f'{page_filename}.meta', '-d', f'{page_filename}.data'])
            assert item_get_fail.returncode != 0
            moin_dir, _ = get_dirs('')
            data_dir = moin_dir / 'src' / 'moin' / 'cli' / '_tests' / 'data'
            item_put = run(['moin', 'item-put', '-m', data_dir / f'{page_filename}.meta', '-d', data_dir / f'{page_filename}.data'])
>           assert_p_succcess(item_put)

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/test_modify_item.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

p = CompletedProcess(args=['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_t...rno 2] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.meta\'\n')

    def assert_p_succcess(p: subprocess.CompletedProcess):
        """assert returncode 0 and print logs on error"""
        try:
>           assert p.returncode == 0
E           AssertionError

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/__init__.py:57: AssertionError
----------------------------------------------------------------- Captured log setup ------------------------------------------------------------------
INFO     moin.cli._tests.conftest:conftest.py:63 artifact_dir = /Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/cli2
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'create-instance']
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'index-create']
---------------------------------------------------------------- Captured stderr call -----------------------------------------------------------------
2024-04-04 20:19:33,010 ERROR moin.cli._tests:59 failure for ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.data')] stdout = b'' stderr = b'2024-04-04 20:19:32,979 INFO moin.cli.maint.modify_item:103 Put item started\nTraceback (most recent call last):\n  File "/Users/tw/w/moin/.tox/py312/bin/moin", line 8, in <module>\n    sys.exit(cli())\n             ^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1157, in __call__\n    return self.main(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1078, in main\n    rv = self.invoke(ctx)\n         ^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1688, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1434, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func\n    return f(get_current_context(), *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/flask/cli.py", line 388, in decorator\n    return ctx.invoke(f, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 104, in cli_PutItem\n    PutItem(meta, data, overwrite)\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 113, in PutItem\n    with open(meta_file, \'rb\') as mf:\n         ^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.meta\'\n'
------------------------------------------------------------------ Captured log call ------------------------------------------------------------------
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'item-get', '-n', 'Home', '-m', 'Home.meta', '-d', 'Home.data']
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.data')]
ERROR    moin.cli._tests:__init__.py:59 failure for ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.data')] stdout = b'' stderr = b'2024-04-04 20:19:32,979 INFO moin.cli.maint.modify_item:103 Put item started\nTraceback (most recent call last):\n  File "/Users/tw/w/moin/.tox/py312/bin/moin", line 8, in <module>\n    sys.exit(cli())\n             ^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1157, in __call__\n    return self.main(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1078, in main\n    rv = self.invoke(ctx)\n         ^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1688, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1434, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func\n    return f(get_current_context(), *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/flask/cli.py", line 388, in decorator\n    return ctx.invoke(f, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 104, in cli_PutItem\n    PutItem(meta, data, overwrite)\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 113, in PutItem\n    with open(meta_file, \'rb\') as mf:\n         ^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.meta\'\n'
____________________________________________________________________ test_item_rev ____________________________________________________________________

index_create2 = CompletedProcess(args=['moin', 'index-create'], returncode=0, stdout=b'', stderr=b'2024-04-04 20:19:33,522 INFO moin.cli.maint.index:51 Index creation started\n2024-04-04 20:19:33,525 INFO moin.cli.maint.index:55 Index creation finished\n')

    def test_item_rev(index_create2):
        """test loading multiple versions of same page
    
        validate -o option when present, revid in meta file is retained otherwise new revid is generated
    
        validate handling of newline at end of file
    
        *  MyPage-v1 does not have newline at end in storage (size = 16)
        *  MyPage-v2 has newline at end in storage (size = 18)
        *  in both cases, item-get will write file with \n at end of file"""
        moin_dir, _ = get_dirs('cli2')
        data_dir = moin_dir / 'src' / 'moin' / 'cli' / '_tests' / 'data'
        put1 = run(['moin', 'item-put', '-m', data_dir / 'MyPage-v1.meta', '-d', data_dir / 'MyPage-v1.data', '-o'])
>       assert_p_succcess(put1)

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/test_modify_item.py:126: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

p = CompletedProcess(args=['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_t...] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.meta\'\n')

    def assert_p_succcess(p: subprocess.CompletedProcess):
        """assert returncode 0 and print logs on error"""
        try:
>           assert p.returncode == 0
E           AssertionError

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/__init__.py:57: AssertionError
----------------------------------------------------------------- Captured log setup ------------------------------------------------------------------
INFO     moin.cli._tests.conftest:conftest.py:63 artifact_dir = /Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/cli2
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'create-instance']
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'index-create']
---------------------------------------------------------------- Captured stderr call -----------------------------------------------------------------
2024-04-04 20:19:33,813 ERROR moin.cli._tests:59 failure for ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.data'), '-o'] stdout = b'' stderr = b'2024-04-04 20:19:33,783 INFO moin.cli.maint.modify_item:103 Put item started\nTraceback (most recent call last):\n  File "/Users/tw/w/moin/.tox/py312/bin/moin", line 8, in <module>\n    sys.exit(cli())\n             ^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1157, in __call__\n    return self.main(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1078, in main\n    rv = self.invoke(ctx)\n         ^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1688, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1434, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func\n    return f(get_current_context(), *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/flask/cli.py", line 388, in decorator\n    return ctx.invoke(f, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 104, in cli_PutItem\n    PutItem(meta, data, overwrite)\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 113, in PutItem\n    with open(meta_file, \'rb\') as mf:\n         ^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.meta\'\n'
------------------------------------------------------------------ Captured log call ------------------------------------------------------------------
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.data'), '-o']
ERROR    moin.cli._tests:__init__.py:59 failure for ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.data'), '-o'] stdout = b'' stderr = b'2024-04-04 20:19:33,783 INFO moin.cli.maint.modify_item:103 Put item started\nTraceback (most recent call last):\n  File "/Users/tw/w/moin/.tox/py312/bin/moin", line 8, in <module>\n    sys.exit(cli())\n             ^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1157, in __call__\n    return self.main(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1078, in main\n    rv = self.invoke(ctx)\n         ^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1688, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1434, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func\n    return f(get_current_context(), *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/flask/cli.py", line 388, in decorator\n    return ctx.invoke(f, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 104, in cli_PutItem\n    PutItem(meta, data, overwrite)\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 113, in PutItem\n    with open(meta_file, \'rb\') as mf:\n         ^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.meta\'\n'
_______________________________________________________________ test_validate_metadata ________________________________________________________________

index_create2 = CompletedProcess(args=['moin', 'index-create'], returncode=0, stdout=b'', stderr=b'2024-04-04 20:19:34,325 INFO moin.cli.maint.index:51 Index creation started\n2024-04-04 20:19:34,328 INFO moin.cli.maint.index:55 Index creation finished\n')

    def test_validate_metadata(index_create2):
        moin_dir, _ = get_dirs('')
        data_dir = moin_dir / 'src' / 'moin' / 'cli' / '_tests' / 'data'
        item_put = run(['moin', 'item-put', '-m', data_dir / 'MyPage-v1.meta', '-d', data_dir / 'MyPage-v1.data', '-o'])
>       assert_p_succcess(item_put)

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/test_modify_item.py:161: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

p = CompletedProcess(args=['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_t...] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.meta\'\n')

    def assert_p_succcess(p: subprocess.CompletedProcess):
        """assert returncode 0 and print logs on error"""
        try:
>           assert p.returncode == 0
E           AssertionError

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/__init__.py:57: AssertionError
----------------------------------------------------------------- Captured log setup ------------------------------------------------------------------
INFO     moin.cli._tests.conftest:conftest.py:63 artifact_dir = /Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/cli2
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'create-instance']
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'index-create']
---------------------------------------------------------------- Captured stderr call -----------------------------------------------------------------
2024-04-04 20:19:34,616 ERROR moin.cli._tests:59 failure for ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.data'), '-o'] stdout = b'' stderr = b'2024-04-04 20:19:34,586 INFO moin.cli.maint.modify_item:103 Put item started\nTraceback (most recent call last):\n  File "/Users/tw/w/moin/.tox/py312/bin/moin", line 8, in <module>\n    sys.exit(cli())\n             ^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1157, in __call__\n    return self.main(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1078, in main\n    rv = self.invoke(ctx)\n         ^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1688, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1434, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func\n    return f(get_current_context(), *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/flask/cli.py", line 388, in decorator\n    return ctx.invoke(f, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 104, in cli_PutItem\n    PutItem(meta, data, overwrite)\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 113, in PutItem\n    with open(meta_file, \'rb\') as mf:\n         ^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.meta\'\n'
------------------------------------------------------------------ Captured log call ------------------------------------------------------------------
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.data'), '-o']
ERROR    moin.cli._tests:__init__.py:59 failure for ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.data'), '-o'] stdout = b'' stderr = b'2024-04-04 20:19:34,586 INFO moin.cli.maint.modify_item:103 Put item started\nTraceback (most recent call last):\n  File "/Users/tw/w/moin/.tox/py312/bin/moin", line 8, in <module>\n    sys.exit(cli())\n             ^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1157, in __call__\n    return self.main(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1078, in main\n    rv = self.invoke(ctx)\n         ^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1688, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1434, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func\n    return f(get_current_context(), *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/flask/cli.py", line 388, in decorator\n    return ctx.invoke(f, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 104, in cli_PutItem\n    PutItem(meta, data, overwrite)\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 113, in PutItem\n    with open(meta_file, \'rb\') as mf:\n         ^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.meta\'\n'
_______________________________________________________ test_validate_metadata_missing_rev_num ________________________________________________________

index_create2 = CompletedProcess(args=['moin', 'index-create'], returncode=0, stdout=b'', stderr=b'2024-04-04 20:19:35,132 INFO moin.cli.maint.index:51 Index creation started\n2024-04-04 20:19:35,135 INFO moin.cli.maint.index:55 Index creation finished\n')

    def test_validate_metadata_missing_rev_num(index_create2):
        moin_dir, _ = get_dirs('')
        data_dir = moin_dir / 'src' / 'moin' / 'cli' / '_tests' / 'data'
        item_put = run(['moin', 'item-put', '-m', data_dir / 'MyPage-vblank.meta', '-d', data_dir / 'MyPage-v1.data', '-o'])
>       assert_p_succcess(item_put)

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/test_modify_item.py:245: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

p = CompletedProcess(args=['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_t... such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-vblank.meta\'\n')

    def assert_p_succcess(p: subprocess.CompletedProcess):
        """assert returncode 0 and print logs on error"""
        try:
>           assert p.returncode == 0
E           AssertionError

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/__init__.py:57: AssertionError
----------------------------------------------------------------- Captured log setup ------------------------------------------------------------------
INFO     moin.cli._tests.conftest:conftest.py:63 artifact_dir = /Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/cli2
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'create-instance']
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'index-create']
---------------------------------------------------------------- Captured stderr call -----------------------------------------------------------------
2024-04-04 20:19:35,424 ERROR moin.cli._tests:59 failure for ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-vblank.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.data'), '-o'] stdout = b'' stderr = b'2024-04-04 20:19:35,393 INFO moin.cli.maint.modify_item:103 Put item started\nTraceback (most recent call last):\n  File "/Users/tw/w/moin/.tox/py312/bin/moin", line 8, in <module>\n    sys.exit(cli())\n             ^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1157, in __call__\n    return self.main(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1078, in main\n    rv = self.invoke(ctx)\n         ^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1688, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1434, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func\n    return f(get_current_context(), *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/flask/cli.py", line 388, in decorator\n    return ctx.invoke(f, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 104, in cli_PutItem\n    PutItem(meta, data, overwrite)\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 113, in PutItem\n    with open(meta_file, \'rb\') as mf:\n         ^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-vblank.meta\'\n'
------------------------------------------------------------------ Captured log call ------------------------------------------------------------------
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-vblank.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.data'), '-o']
ERROR    moin.cli._tests:__init__.py:59 failure for ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-vblank.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-v1.data'), '-o'] stdout = b'' stderr = b'2024-04-04 20:19:35,393 INFO moin.cli.maint.modify_item:103 Put item started\nTraceback (most recent call last):\n  File "/Users/tw/w/moin/.tox/py312/bin/moin", line 8, in <module>\n    sys.exit(cli())\n             ^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1157, in __call__\n    return self.main(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1078, in main\n    rv = self.invoke(ctx)\n         ^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1688, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1434, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func\n    return f(get_current_context(), *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/flask/cli.py", line 388, in decorator\n    return ctx.invoke(f, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 104, in cli_PutItem\n    PutItem(meta, data, overwrite)\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 113, in PutItem\n    with open(meta_file, \'rb\') as mf:\n         ^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/MyPage-vblank.meta\'\n'
________________________________________________________________ test_load_default_ns _________________________________________________________________

artifact_dir = PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/cli')
save_default = CompletedProcess(args=['moin', 'save', '-b', 'default', '-f', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/_t...maint.serialization:59 Backup started\n2024-04-04 20:19:43,098 INFO moin.cli.maint.serialization:70 Backup finished\n')

    def test_load_default_ns(artifact_dir, save_default):
        moin_dir, _ = get_dirs('')
        welcome_dir = moin_dir / 'src' / 'moin' / 'help' / 'welcome'
        expected_metas = {}
        for data_fn in welcome_dir.glob('*.meta'):
            with open(data_fn) as f:
                meta = json.load(f)
                if meta[NAMESPACE] != '':
                    continue
                name = meta[NAME][0]
                expected_metas[name] = meta
        restore_dir = Path(artifact_dir / 'restore_default')
        load(restore_dir, 'backup_default.moin', artifact_dir)
        os.chdir(restore_dir)
        try:
            index_dump = run(['moin', 'index-dump', '--no-truncate'])
            metas = {}
            contents = {}
            items = read_index_dump_latest_revs(index_dump.stdout.decode())
            for item in items:
                name = item[NAME][0]
                content = item.pop(CONTENT)
                metas[name] = item
>           assert set(expected_metas.keys()) == set(metas.keys())
E           AssertionError: assert set() == {'Home'}
E             
E             Extra items in the right set:
E             'Home'
E             Use -v to get more diff

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/test_serialization.py:72: AssertionError
------------------------------------------------------------------ Captured log call ------------------------------------------------------------------
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'create-instance']
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'index-create']
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'load', '-f', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/backup_default.moin')]
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'index-dump', '--no-truncate']
__________________________________________________________________ test_load_corrupt __________________________________________________________________

artifact_dir2 = PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/cli2')
index_create2 = CompletedProcess(args=['moin', 'index-create'], returncode=0, stdout=b'', stderr=b'2024-04-04 20:19:46,015 INFO moin.cli.maint.index:51 Index creation started\n2024-04-04 20:19:46,018 INFO moin.cli.maint.index:55 Index creation finished\n')

    def test_load_corrupt(artifact_dir2, index_create2):
        moin_dir, _ = get_dirs('cli')
        data_dir = moin_dir / 'src' / 'moin' / 'cli' / '_tests' / 'data'
        # item-put below errors out without the -o, see moin.storage.backends.stores.store
        p = run(['moin', 'item-put', '-m', data_dir / 'Corrupt.meta', '-d', data_dir / 'Corrupt.data', '-o'])
>       assert_p_succcess(p)

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/test_serialization.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

p = CompletedProcess(args=['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_t... 2] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Corrupt.meta\'\n')

    def assert_p_succcess(p: subprocess.CompletedProcess):
        """assert returncode 0 and print logs on error"""
        try:
>           assert p.returncode == 0
E           AssertionError

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/__init__.py:57: AssertionError
----------------------------------------------------------------- Captured log setup ------------------------------------------------------------------
INFO     moin.cli._tests.conftest:conftest.py:63 artifact_dir = /Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/cli2
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'create-instance']
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'index-create']
---------------------------------------------------------------- Captured stderr call -----------------------------------------------------------------
2024-04-04 20:19:46,319 ERROR moin.cli._tests:59 failure for ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Corrupt.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Corrupt.data'), '-o'] stdout = b'' stderr = b'2024-04-04 20:19:46,287 INFO moin.cli.maint.modify_item:103 Put item started\nTraceback (most recent call last):\n  File "/Users/tw/w/moin/.tox/py312/bin/moin", line 8, in <module>\n    sys.exit(cli())\n             ^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1157, in __call__\n    return self.main(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1078, in main\n    rv = self.invoke(ctx)\n         ^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1688, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1434, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func\n    return f(get_current_context(), *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/flask/cli.py", line 388, in decorator\n    return ctx.invoke(f, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 104, in cli_PutItem\n    PutItem(meta, data, overwrite)\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 113, in PutItem\n    with open(meta_file, \'rb\') as mf:\n         ^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Corrupt.meta\'\n'
------------------------------------------------------------------ Captured log call ------------------------------------------------------------------
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Corrupt.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Corrupt.data'), '-o']
ERROR    moin.cli._tests:__init__.py:59 failure for ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Corrupt.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Corrupt.data'), '-o'] stdout = b'' stderr = b'2024-04-04 20:19:46,287 INFO moin.cli.maint.modify_item:103 Put item started\nTraceback (most recent call last):\n  File "/Users/tw/w/moin/.tox/py312/bin/moin", line 8, in <module>\n    sys.exit(cli())\n             ^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1157, in __call__\n    return self.main(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1078, in main\n    rv = self.invoke(ctx)\n         ^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1688, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1434, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func\n    return f(get_current_context(), *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/flask/cli.py", line 388, in decorator\n    return ctx.invoke(f, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 104, in cli_PutItem\n    PutItem(meta, data, overwrite)\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 113, in PutItem\n    with open(meta_file, \'rb\') as mf:\n         ^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Corrupt.meta\'\n'
____________________________________________________________________ test_set_meta ____________________________________________________________________

index_create2 = CompletedProcess(args=['moin', 'index-create'], returncode=0, stdout=b'', stderr=b'2024-04-04 20:19:46,918 INFO moin.cli.maint.index:51 Index creation started\n2024-04-04 20:19:46,921 INFO moin.cli.maint.index:55 Index creation finished\n')

    def test_set_meta(index_create2):
        moin_dir, _ = get_dirs('')
        data_dir = moin_dir / 'src' / 'moin' / 'cli' / '_tests' / 'data'
        put = run(['moin', 'item-put', '-m', data_dir / 'Home.meta', '-d', data_dir / 'Home.data', '-o'])
>       assert_p_succcess(put)

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/test_set_meta.py:18: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

p = CompletedProcess(args=['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_t...rno 2] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.meta\'\n')

    def assert_p_succcess(p: subprocess.CompletedProcess):
        """assert returncode 0 and print logs on error"""
        try:
>           assert p.returncode == 0
E           AssertionError

/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/_tests/__init__.py:57: AssertionError
----------------------------------------------------------------- Captured log setup ------------------------------------------------------------------
INFO     moin.cli._tests.conftest:conftest.py:63 artifact_dir = /Users/tw/w/moin/.tox/py312/lib/python3.12/_test_artifacts/cli2
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'create-instance']
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'index-create']
---------------------------------------------------------------- Captured stderr call -----------------------------------------------------------------
2024-04-04 20:19:47,226 ERROR moin.cli._tests:59 failure for ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.data'), '-o'] stdout = b'' stderr = b'2024-04-04 20:19:47,192 INFO moin.cli.maint.modify_item:103 Put item started\nTraceback (most recent call last):\n  File "/Users/tw/w/moin/.tox/py312/bin/moin", line 8, in <module>\n    sys.exit(cli())\n             ^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1157, in __call__\n    return self.main(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1078, in main\n    rv = self.invoke(ctx)\n         ^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1688, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1434, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func\n    return f(get_current_context(), *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/flask/cli.py", line 388, in decorator\n    return ctx.invoke(f, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 104, in cli_PutItem\n    PutItem(meta, data, overwrite)\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 113, in PutItem\n    with open(meta_file, \'rb\') as mf:\n         ^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.meta\'\n'
------------------------------------------------------------------ Captured log call ------------------------------------------------------------------
INFO     moin.cli._tests:__init__.py:36 running ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.data'), '-o']
ERROR    moin.cli._tests:__init__.py:59 failure for ['moin', 'item-put', '-m', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.meta'), '-d', PosixPath('/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.data'), '-o'] stdout = b'' stderr = b'2024-04-04 20:19:47,192 INFO moin.cli.maint.modify_item:103 Put item started\nTraceback (most recent call last):\n  File "/Users/tw/w/moin/.tox/py312/bin/moin", line 8, in <module>\n    sys.exit(cli())\n             ^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1157, in __call__\n    return self.main(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1078, in main\n    rv = self.invoke(ctx)\n         ^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1688, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 1434, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func\n    return f(get_current_context(), *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/flask/cli.py", line 388, in decorator\n    return ctx.invoke(f, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/click/core.py", line 783, in invoke\n    return __callback(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 104, in cli_PutItem\n    PutItem(meta, data, overwrite)\n  File "/Users/tw/w/moin/.tox/py312/lib/python3.12/site-packages/moin/cli/maint/modify_item.py", line 113, in PutItem\n    with open(meta_file, \'rb\') as mf:\n         ^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: \'/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/data/Home.meta\'\n'

@ThomasWaldmann
Copy link
Member Author

ThomasWaldmann commented Apr 4, 2024

This is due to wrong assumptions, just as an example:

E           FileNotFoundError: [Errno 2] No such file or directory: '/Users/tw/w/moin/.tox/py312/lib/python3.12/src/moin/cli/_tests/scrapy'

Obviously, this works when tests are run "in place" (in the work dir), but not when moin is installed into a separate venv (this is how tox runs tests for misc. python versions).

Also not sure whether it is a good idea to os.chdir while running the tests.

@ThomasWaldmann ThomasWaldmann added this to the 2.0.0c1 milestone Apr 4, 2024
@tt2tak
Copy link

tt2tak commented Oct 27, 2024

It seems to be due to the fact that the path is assumed to include the 'src' directory.

def get_dirs(subdir: str) -> tuple[Path, Path]:
"""return Paths for directories used in tests creating artifacts_dir if needed
:param subdir: subdirectory for artifacts_dir
:returns: tuple (moin_dir, artifacts_dir)
where moin_dir is Path to moin directory, parent of src
and artifacts_dir is Path to moin/_test_artifacts/{subdir}"""
my_dir = Path(__file__).parent.resolve()
moin_dir = my_dir.parents[2]
artifacts_dir = moin_dir / "_test_artifacts" / subdir
if not artifacts_dir.exists():
artifacts_dir.mkdir(parents=True)
return moin_dir, artifacts_dir

I think we can solve this problem by making it the directory where the module is installed.

moin_dir = my_dir.parents[2]

The fix to the get_dirs function will also require modifications to the associated test cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants