Skip to content
GitLab
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Reproducible Builds
diffoscope
Compare revisions
ee2fb1e9804e997045fb852cdde02c7bd1351aae...ef878ecad7d4278d675434ca5d59dd430ea9052c
Commits (2)
Use skipif instead of manual conditionals.
· 34df4921
Chris Lamb
authored
Oct 28, 2021
34df4921
Skip Python bytecode testing where we do not have an expected diff. (Closes:...
· ef878eca
Chris Lamb
authored
Oct 28, 2021
Skip Python bytecode testing where we do not have an expected diff. (Closes:
#284
)
ef878eca
Hide whitespace changes
Inline
Side-by-side
tests/comparators/test_python.py
View file @
ef878eca
...
...
@@ -22,6 +22,7 @@ import sys
from
diffoscope.comparators.python
import
PycFile
from
..utils.data
import
assert_diff_startswith
,
load_fixture
from
..utils.tools
import
skipif
pyc1
=
load_fixture
(
"test1.pyc-renamed"
)
...
...
@@ -33,12 +34,12 @@ def test_identification(pyc1, pyc2):
assert
isinstance
(
pyc2
,
PycFile
)
@skipif
(
sys
.
version_info
>=
(
3
,
10
),
reason
=
"Unstable on 3.10+"
)
def
test_no_differences
(
pyc1
):
# Disassembling bytecode prior to Python 3.10 is stable when applied to
# itself, otherwise various memory offsets (or memory addresses?) are
# non-deterministic.
if
sys
.
version_info
<
(
3
,
10
):
assert
pyc1
.
compare
(
pyc1
)
is
None
assert
pyc1
.
compare
(
pyc1
)
is
None
@pytest.fixture
...
...
@@ -46,6 +47,10 @@ def differences(pyc1, pyc2):
return
pyc1
.
compare
(
pyc2
).
details
@skipif
(
sys
.
version_info
<
(
3
,
9
),
reason
=
"pyc_expected_diff generated on Python 3.9"
,
)
def
test_diff
(
differences
):
assert_diff_startswith
(
differences
[
0
],
...
...