Skip to content

Commit

Permalink
tests: avoid architecture and Python-version dependent test
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Oct 23, 2024
1 parent 7ab966d commit f98f57b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0.62.7
- tests: avoid architecture and Python-version dependent test
0.62.6
- enh: support passing pathlib.Path to lme4.rsetup.set_*_path methods
- docs: correct keyword arguments for advanced section on S3
Expand Down
19 changes: 6 additions & 13 deletions tests/test_rtdc_feat_anc_plugin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pathlib
import sys
import tempfile
import traceback

Expand Down Expand Up @@ -134,21 +133,15 @@ def test_pf_attribute_ancill_info():
def test_pf_attribute_plugin_feature_info():
"""Check the plugin feature info attribute"""
info = example_plugin_info_single_feature()
# The identifier is dependent on the compiled byte code of the
# function code (__code__.co_code), which can be different between
# python versions (normally, the content of the plugin file would be used).
if tuple(sys.version_info)[:3] < (3, 11, 0):
identifier = "3a3e72c4cb015424ebbe6d4af63f2170"
elif tuple(sys.version_info)[:3] < (3, 12, 0):
# bytecode changed in Python 3.11
identifier = "322e9a30665c8603ed2dd6fb9d7b18da"
else:
# bytecode changed in Python 3.12
identifier = "447e1ae998c716140f31614a4da2581f"
# comparing lambda functions fails due to differing memory locations
info.pop("method check required")
pf = PlugInFeature("circ_per_area", info)
pf.plugin_feature_info.pop("method check required")
# The identifier is dependent on the compiled byte code of the
# function code (__code__.co_code), which can be different between
# python versions and architectures.
identifier = pf.plugin_feature_info.pop("identifier")
assert len(identifier) == 32
plugin_feature_info = {
"method": compute_single_plugin_feature,
"description": "This plugin will compute a feature",
Expand All @@ -162,8 +155,8 @@ def test_pf_attribute_plugin_feature_info():
"scalar feature": True,
"version": "0.1.0",
"plugin path": None,
"identifier": identifier,
}

assert pf.plugin_feature_info == plugin_feature_info


Expand Down

0 comments on commit f98f57b

Please sign in to comment.