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

tests: Avoid using match of pytest.raises together with paths #11638

Merged

Conversation

xdustinface
Copy link
Contributor

@xdustinface xdustinface commented May 25, 2022

Fixes failures like below. See https://github.com/Chia-Network/chia-blockchain/actions/runs/2386606563 for a test run against #10681.

______________________ test_harvester_add_plot_directory 
______________________
[gw1] win32 -- Python 3.7.9 
d:\a\chia-blockchain\chia-blockchain\venv\scripts\python.exe
tests\core\test_farmer_harvester_rpc.py:573: in 
test_harvester_add_plot_directory
    await harvester_rpc_client.add_plot_directory(str(test_path))
chia\rpc\harvester_rpc_client.py:25: in add_plot_directory
    return (await self.fetch("add_plot_directory", {"dirname": 
dirname}))["success"]
chia\rpc\rpc_client.py:49: in fetch
    raise ValueError(res_json)
E   ValueError: {'error': "Path doesn't exist: 
C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\popen-gw1\\test_harvester_add_plot_direct0\\harvester\\test_path", 
'success': False}

During handling of the above exception, another exception occurred:
tests\core\test_farmer_harvester_rpc.py:573: in 
test_harvester_add_plot_directory
    await harvester_rpc_client.add_plot_directory(str(test_path))
C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\re.py:185: in search
    return _compile(pattern, flags).search(string)
C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\re.py:288: in _compile
    p = sre_compile.compile(pattern, flags)
C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\sre_compile.py:764: in 
compile
    p = sre_parse.parse(p, flags)
C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\sre_parse.py:924: in 
parse
    p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\sre_parse.py:420: in 
_parse_sub
    not nested and not items))
C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\sre_parse.py:501: in 
_parse
    code = _escape(source, this, state)
C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\sre_parse.py:369: in 
_escape
    raise source.error("incomplete escape %s" % escape, len(escape))
E   re.error: incomplete escape \U at position 22

@xdustinface xdustinface requested a review from altendky May 25, 2022 19:14
@xdustinface xdustinface changed the base branch from windows_ci to main May 25, 2022 19:28
@xdustinface xdustinface reopened this May 25, 2022
@xdustinface xdustinface force-pushed the pr-tests-add-plot-directories-windows branch 2 times, most recently from 36d749f to eb1ac2f Compare May 25, 2022 22:01
Fixes failures like: 
```
______________________ test_harvester_add_plot_directory 
______________________
[gw1] win32 -- Python 3.7.9 
d:\a\chia-blockchain\chia-blockchain\venv\scripts\python.exe
tests\core\test_farmer_harvester_rpc.py:573: in 
test_harvester_add_plot_directory
    await harvester_rpc_client.add_plot_directory(str(test_path))
chia\rpc\harvester_rpc_client.py:25: in add_plot_directory
    return (await self.fetch("add_plot_directory", {"dirname": 
dirname}))["success"]
chia\rpc\rpc_client.py:49: in fetch
    raise ValueError(res_json)
E   ValueError: {'error': "Path doesn't exist: 
C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\popen-gw1\\test_harvester_add_plot_direct0\\harvester\\test_path", 
'success': False}

During handling of the above exception, another exception occurred:
tests\core\test_farmer_harvester_rpc.py:573: in 
test_harvester_add_plot_directory
    await harvester_rpc_client.add_plot_directory(str(test_path))
C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\re.py:185: in search
    return _compile(pattern, flags).search(string)
C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\re.py:288: in _compile
    p = sre_compile.compile(pattern, flags)
C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\sre_compile.py:764: in 
compile
    p = sre_parse.parse(p, flags)
C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\sre_parse.py:924: in 
parse
    p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\sre_parse.py:420: in 
_parse_sub
    not nested and not items))
C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\sre_parse.py:501: in 
_parse
    code = _escape(source, this, state)
C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\sre_parse.py:369: in 
_escape
    raise source.error("incomplete escape %s" % escape, len(escape))
E   re.error: incomplete escape \U at position 22
```
@xdustinface xdustinface force-pushed the pr-tests-add-plot-directories-windows branch from eb1ac2f to 1cbb5ef Compare May 25, 2022 22:05
@xdustinface xdustinface added the ready_to_merge Submitter and reviewers think this is ready label May 26, 2022
@hoffmang9 hoffmang9 merged commit 5844c6c into Chia-Network:main May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready_to_merge Submitter and reviewers think this is ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants