Skip to content
Snippets Groups Projects
Commit 8052ceb5 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Don't bother to check version number in test_python.py: the fixture for this test is fixed.

parent c9c69fcd
No related branches found
No related tags found
No related merge requests found
......@@ -17,39 +17,23 @@
# along with diffoscope. If not, see <https://www.gnu.org/licenses/>.
import pytest
import sys
from diffoscope.comparators.python import PycFile
from ..utils.data import assert_diff_startswith, load_fixture
from ..utils.nonexisting import assert_non_existing
from ..utils.tools import (
skipif,
skip_unless_file_version_is_at_least,
)
from ..utils.tools import skip_unless_file_version_is_at_least
pyc1 = load_fixture("test1.pyc-renamed")
pyc2 = load_fixture("test2.pyc-renamed")
def skip_unless_correct_python_version():
TEST_FIXTURES_GENERATED_BY = (3, 12)
display = ".".join(str(x) for x in TEST_FIXTURES_GENERATED_BY)
return skipif(
sys.version_info[:2] != TEST_FIXTURES_GENERATED_BY,
reason=f"Only Python {display} can de-marshal test1.pyc-renamed",
)
@skip_unless_file_version_is_at_least("5.39")
def test_identification(pyc1, pyc2):
assert isinstance(pyc1, PycFile)
assert isinstance(pyc2, PycFile)
@skip_unless_correct_python_version()
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
......@@ -63,7 +47,6 @@ def differences(pyc1, pyc2):
@skip_unless_file_version_is_at_least("5.39")
@skip_unless_correct_python_version()
def test_diff(differences):
assert_diff_startswith(differences[0], "pyc_expected_diff")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment