Skip to content

Commit

Permalink
Disable tests in older Python versions that fail due to different err…
Browse files Browse the repository at this point in the history
…or messages.
  • Loading branch information
scoder committed Nov 29, 2024
1 parent 7a846ab commit 62fe5fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/test_fractions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def requires_IEEE_754(test): return test
F = quicktions.Fraction
gcd = quicktions._gcd

requires_py310 = unittest.skipIf(sys.version_info <= (3, 10), "needs Python 3.10+")

#locate file with float format test values
test_dir = os.path.dirname(__file__) or os.curdir
format_testfile = os.path.join(test_dir, 'formatfloat_testcases.txt')
Expand Down Expand Up @@ -1860,6 +1862,7 @@ def test_float_format_testfile(self):
self.assertEqual(float(format(f, fmt2)), float(rhs))
self.assertEqual(float(format(-f, fmt2)), float('-' + rhs))

@requires_py310
def test_complex_handling(self):
# See issue gh-102840 for more details.

Expand Down Expand Up @@ -1887,6 +1890,7 @@ def test_complex_handling(self):
message % ("divmod()", "complex", "quicktions.Fraction"),
divmod, b, a)

@requires_py310
def test_three_argument_pow(self):
message = "unsupported operand type(s) for ** or pow(): '%s', '%s', '%s'"
self.assertRaisesMessage(TypeError,
Expand Down

0 comments on commit 62fe5fc

Please sign in to comment.