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
pyhon3Packages.deal: fix build by disabling test #211262
Conversation
Disable 'test_exception_hook'. Since commit 6d9c724 (pytest 7.1.3 -> 7.2.0) the test fails. Official CI builds with pytest 7.1.2. There doesn't seem to be a way to submit an upstream issue. Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/1722 |
@@ -77,6 +77,8 @@ buildPythonPackage rec { | |||
"test_scheme_contract_is_satisfied_when_setting_arg" | |||
"test_scheme_contract_is_satisfied_within_chain" | |||
"test_scheme_errors_rewrite_message" | |||
# broken since pytest > 7.1.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More important what is broken? What's the error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Sandro,
the error message is:
_____________________________ test_exception_hook ______________________________
capsys = <_pytest.capture.CaptureFixture object at 0x7ffff1d97bb0>
def test_exception_hook(capsys):
pre_path = str(Path('deal', '_runtime', '_contracts.py'))
f = deal.pre(lambda x: x > 0)(lambda x: x)
with pytest.raises(deal.PreContractError) as exc_info:
f(-2)
# custom hook is registered
assert sys.excepthook is exception_hook
# the default hook shows the full traceback
_excepthook(exc_info.type, exc_info.value, exc_info.tb)
captured = capsys.readouterr()
assert captured.out == ''
assert pre_path in captured.err
# the custom hook hides deal from the traceback
exception_hook(exc_info.type, exc_info.value, exc_info.tb)
captured = capsys.readouterr()
assert captured.out == ''
# the hook doesn't work on python 3.6 and below
if sys.version_info[:2] >= (3, 7):
> assert pre_path not in captured.err
E assert 'deal/_runti...contracts.py' not in 'Traceback (...-2\x1b[0m)\n'
E 'deal/_runtime/_contracts.py' is contained here:
E ld/source/deal/_runtime/_contracts.py", line 87, in wrapper
E return contracts._run_sync(args, kwargs)
E File "/build/source/deal/_runtime/_contracts.py", line 119, in _run_sync
E validator.validate(args, kwargs)
E File "/build/source/deal/_runtime/_validators.py", line 175, in _init
E self.validate(args, kwargs, exc)...
E
E ...Full output truncated (4 lines hidden), use '-vv' to show
tests/test_exceptions.py:201: AssertionError
So now the custom hook doesn't seem to hide deal
from the stacktrace. My guess was that pytest now includes more output in the stacktrace. I haven't found anything conclusive on the changelog for pytest though. Also all other tests pass and I'm not sure how relevant this error is.
Also since there doesn't seem to be a way to post issues to upstream, this could potentially take some time to fix the test upstream.
Therefore I excluded the test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment should probably include that the stacktrace since pytest 7.1.3 no longer matches upstreams assertion.
Result of 6 packages built:
|
Description of changes
Disable 'test_exception_hook'.
Since commit 6d9c724 (pytest 7.1.3 -> 7.2.0) the test fails.
Official CI builds with pytest 7.1.2. There doesn't seem to be a way to submit an upstream issue.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes