%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
import sys
import unittest
from gevent import testing as greentest
class TestSubnormalFloatsAreNotDisabled(unittest.TestCase):
@greentest.skipOnCI('Some of our tests we compile with -Ofast, which breaks this.')
def test_subnormal_is_not_zero(self):
# Enabling the -Ofast compiler flag resulted in subnormal floats getting
# disabled the moment when gevent was imported. This impacted libraries
# that expect subnormal floats to be enabled.
#
# NOTE: This test is supposed to catch that. It doesn't seem to work perfectly, though.
# The test passes under Python 2 on macOS no matter whether -ffast-math is given or not;
# perhaps this is a difference in clang vs gcc? In contrast, the test on Python 2.7 always
# *fails* on GitHub actions (in both CPython 2.7 and PyPy). We're far past the EOL of
# Python 2.7 so I'm not going to spend much time investigating.
__import__('gevent')
# `sys.float_info.min` is the minimum representable positive normalized
# float, so dividing it by two gives us a positive subnormal float,
# as long as subnormals floats are not disabled.
self.assertGreater(sys.float_info.min / 2, 0.0)
if __name__ == "__main__":
unittest.main()