Skip to content

Commit

Permalink
Handle Python version behavior change in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rec committed Feb 14, 2024
1 parent a49d047 commit 93b79ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/test_xmod.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import platform
import unittest


Expand Down Expand Up @@ -105,12 +106,15 @@ def test_decorator_with_parameter(self):
assert decorator_with_parameter.BAR == 99

def test_partial_function(self):
minor = int(platform.python_version_tuple()[1])
try:
from .modules import partial_function
except ValueError as e:
assert minor < 10
assert e.args == ('`name` parameter must be set',)
else:
assert partial_function and False
assert minor >= 10
assert partial_function


COMMON = [
Expand Down

0 comments on commit 93b79ec

Please sign in to comment.