Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
python-pyforge
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Debian
python-pyforge
Commits
61d915e7
Commit
61d915e7
authored
5 months ago
by
Stuart Prescott
Browse files
Options
Downloads
Patches
Plain Diff
Cherry-pick patch for Python 3.13
Closes: #1082257
parent
9b28baed
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
debian/patches/python3.13.patch
+46
-0
46 additions, 0 deletions
debian/patches/python3.13.patch
debian/patches/series
+1
-0
1 addition, 0 deletions
debian/patches/series
with
47 additions
and
0 deletions
debian/patches/python3.13.patch
0 → 100644
+
46
−
0
View file @
61d915e7
commit 02c655d4f7a6e12351437cdbc26e07cd64716953
Author: Ayala Shachar <shachar.ayala@gmail.com>
Date: Wed Oct 2 22:24:54 2024 +0300
Fix unittests for python3.13
diff --git a/tests/test__signature_object.py b/tests/test__signature_object.py
index 304b104..1415a60 100644
--- a/tests/test__signature_object.py
+++ b/tests/test__signature_object.py
@@ -1,4 +1,5 @@
import time
+import sys
from .ut_utils import TestCase
from forge.signature import FunctionSignature
from forge.exceptions import SignatureException, InvalidKeywordArgument, FunctionCannotBeBound
@@ -126,11 +127,26 @@
class SignatureTest(TestCase):
self.assertIsNot(f._args, f2._args)
class BinaryFunctionSignatureTest(TestCase):
- def test__binary_global_function(self):
+ def test__binary_global_function_with_no_parameters(self):
sig = FunctionSignature(time.time)
self.assertEqual(sig._args, [])
- self.assertTrue(sig.has_variable_args())
- self.assertTrue(sig.has_variable_kwargs())
+ if sys.version_info[:2] < (3, 13):
+ self.assertTrue(sig.has_variable_args())
+ self.assertTrue(sig.has_variable_kwargs())
+ else:
+ # Starting 3.13, inspect succeed (not raise TypeError) for buildin functions, like `time.time`
+ self.assertFalse(sig.has_variable_args())
+ self.assertFalse(sig.has_variable_kwargs())
+ def test__binary_global_function_with_parameters(self):
+ sig = FunctionSignature(time.sleep)
+ if sys.version_info[:2] < (3, 13):
+ self.assertEqual(sig._args, [])
+ self.assertTrue(sig.has_variable_args())
+ self.assertTrue(sig.has_variable_kwargs())
+ else:
+ self.assertEqual(len(sig._args), 1)
+ self.assertFalse(sig.has_variable_args())
+ self.assertFalse(sig.has_variable_kwargs())
def test__object_method_placeholders(self):
class SomeObject(object):
pass
This diff is collapsed.
Click to expand it.
debian/patches/series
+
1
−
0
View file @
61d915e7
pyver.patch
tox-pytest.patch
python3.13.patch
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