<s> from __future__ import print_function , division , absolute_import <EOL> import imp <EOL> import sys <EOL> from numba import unittest_support as unittest <EOL> class TestLlvmVersion ( unittest . TestCase ) : <EOL> def test_llvmlite_version ( self ) : <EOL> import llvmlite <EOL> import numba <EOL> self . assertTrue ( numba . __version__ ) <EOL> llvmlite_version = llvmlite . __version__ <EOL> def cleanup ( ) : <EOL> llvmlite . __version__ = llvmlite_version <EOL> self . addCleanup ( cleanup ) <EOL> ver = numba . _min_llvmlite_version <EOL> version_pass = '<STR_LIT>' % ver <EOL> git_version_pass = '<STR_LIT>' % ver <EOL> rc_version_pass = '<STR_LIT>' % ( ver [ <NUM_LIT:0> ] , ver [ <NUM_LIT:1> ] , ver [ <NUM_LIT:2> ] + <NUM_LIT:1> ) <EOL> version_fail = '<STR_LIT>' % ( ver [ <NUM_LIT:0> ] , ver [ <NUM_LIT:1> ] - <NUM_LIT:1> ) <EOL> git_version_fail = '<STR_LIT>' % ( ver [ <NUM_LIT:0> ] , ver [ <NUM_LIT:1> ] - <NUM_LIT:1> ) <EOL> ver_pass = ( version_pass , git_version_pass , rc_version_pass ) <EOL> ver_fail = ( version_fail , git_version_fail ) <EOL> for v in ver_pass : <EOL> llvmlite . __version__ = v <EOL> imp . reload ( numba ) <EOL> self . assertTrue ( numba . __version__ ) <EOL> for v in ver_fail : <EOL> with self . assertRaises ( ImportError ) : <EOL> llvmlite . __version__ = v <EOL> imp . reload ( numba ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
