Skip to content

Commit

Permalink
Make assertRaisesRegex available in python2
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Dec 7, 2022
1 parent 022cc4d commit cb5f9df
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/tests/Test_Tagging.py
Expand Up @@ -11,7 +11,13 @@
except ImportError: # for python3
import builtins
builtin_module_name = 'builtins'

import unittest
try: # monkey patch python2 to also use non-deprecated functionality
unittest.TestCase.assertRaisesRegex
except AttributeError:
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp

import os
import shutil
import sys
Expand Down

0 comments on commit cb5f9df

Please sign in to comment.