Skip to content

Instantly share code, notes, and snippets.

@Bas-Man
Created April 22, 2020 13:31
Show Gist options
  • Save Bas-Man/bd3425dd09585398da7e7970f62b67e7 to your computer and use it in GitHub Desktop.
Save Bas-Man/bd3425dd09585398da7e7970f62b67e7 to your computer and use it in GitHub Desktop.
One method of mocking the values for sys.version_info.major/minor
def test_python2TooLow():
with mock.patch.object(sys, 'version_info') as v_info:
v_info.major = 2
v_info.minor = 7
assert helper.system.meetsMinSpecs(3, 0) == False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment