Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3.12: two tests fail #218

Open
penguinpee opened this issue Sep 5, 2023 · 0 comments
Open

Python3.12: two tests fail #218

penguinpee opened this issue Sep 5, 2023 · 0 comments

Comments

@penguinpee
Copy link

I just applied c00b217 for making the package Python3.12 compatible in Fedora.

Now I have two tests failing with TypeError: 'float' object cannot be interpreted as an integer:

======================================================================
ERROR: test_testsuite (sciunit.unit_test.test_tests.TestSuitesTestCase.test_testsuite)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/sciunit-c70f3886f49ebd71bfc8d33c9821f2e40341f3ce/sciunit/unit_test/test_tests.py", line 111, in test_testsuite
    t = TestSuite([t1, t2])
        ^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/sciunit-c70f3886f49ebd71bfc8d33c9821f2e40341f3ce/sciunit/suites.py", line 43, in __init__
    self.name = name if name else "Suite_%d" % random.randint(0, 1e12)
                                               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/random.py", line 336, in randint
    return self.randrange(a, b+1)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/random.py", line 312, in randrange
    istop = _index(stop)
            ^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer

======================================================================
ERROR: test_testsuite_set_verbose (sciunit.unit_test.test_tests.TestSuitesTestCase.test_testsuite_set_verbose)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/sciunit-c70f3886f49ebd71bfc8d33c9821f2e40341f3ce/sciunit/unit_test/test_tests.py", line 160, in test_testsuite_set_verbose
    t = TestSuite([t1, t2])
        ^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/sciunit-c70f3886f49ebd71bfc8d33c9821f2e40341f3ce/sciunit/suites.py", line 43, in __init__
    self.name = name if name else "Suite_%d" % random.randint(0, 1e12)
                                               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/random.py", line 336, in randint
    return self.randrange(a, b+1)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/random.py", line 312, in randrange
    istop = _index(stop)
            ^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer

----------------------------------------------------------------------
Ran 83 tests in 21.478s

FAILED (errors=2, skipped=5)

I believe this is related to Python3.12 changes, but it's beyond me to investigate further, atm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant