Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
diffoscope
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reproducible Builds
diffoscope
Commits
8052ceb5
Commit
8052ceb5
authored
9 months ago
by
Chris Lamb
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/comparators/test_python.py
+1
-18
1 addition, 18 deletions
tests/comparators/test_python.py
with
1 addition
and
18 deletions
tests/comparators/test_python.py
+
1
−
18
View file @
8052ceb5
...
...
@@ -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
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment