<s> import mock <EOL> from nose . plugins import skip <EOL> from freezegun import api <EOL> from tests import utils <EOL> try : <EOL> reload <EOL> except NameError : <EOL> try : <EOL> from importlib import reload <EOL> except ImportError : <EOL> from imp import reload <EOL> @ mock . patch ( '<STR_LIT>' , lambda : '<STR_LIT>' ) <EOL> def test_should_not_skip_cpython ( ) : <EOL> reload ( api ) <EOL> reload ( utils ) <EOL> function_mock = mock . MagicMock ( __name__ = '<STR_LIT>' ) <EOL> try : <EOL> utils . cpython_only ( function_mock ) ( ) <EOL> except skip . SkipTest : <EOL> raise AssertionError ( "<STR_LIT>" ) <EOL> assert function_mock . called <EOL> @ mock . patch ( '<STR_LIT>' , lambda : '<STR_LIT>' ) <EOL> def test_should_skip_non_cpython ( ) : <EOL> reload ( api ) <EOL> reload ( utils ) <EOL> function_mock = mock . MagicMock ( __name__ = '<STR_LIT>' , skipped = False ) <EOL> try : <EOL> utils . cpython_only ( function_mock ) ( ) <EOL> except skip . SkipTest : <EOL> function_mock . skipped = True <EOL> assert not function_mock . called <EOL> assert function_mock . skipped </s>
