aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-12-02 13:45:28 -0800
committerDylan Baker <dylan@pnwbakers.com>2019-12-02 16:39:06 -0800
commit71e3fac5af1027f88a48c0beb78c3994cea57629 (patch)
tree9d4acb59224029af70b6965f73b47628af329243 /run_unittests.py
parent2450cd6a9fdc51895dcce461312768a485959b7e (diff)
downloadmeson-71e3fac5af1027f88a48c0beb78c3994cea57629.zip
meson-71e3fac5af1027f88a48c0beb78c3994cea57629.tar.gz
meson-71e3fac5af1027f88a48c0beb78c3994cea57629.tar.bz2
run_unittests: remove unused PatchModule class
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py21
1 files changed, 1 insertions, 20 deletions
diff --git a/run_unittests.py b/run_unittests.py
index bf67729..74e5803 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -290,26 +290,6 @@ def no_pkgconfig():
shutil.which = old_which
ExternalProgram._search = old_search
-class PatchModule:
- '''
- Fancy monkey-patching! Whee! Can't use mock.patch because it only
- patches in the local namespace.
- '''
-
- def __init__(self, func, name, impl):
- self.func = func
- assert(isinstance(name, str))
- self.func_name = name
- self.old_impl = None
- self.new_impl = impl
-
- def __enter__(self):
- self.old_impl = self.func
- exec('{} = self.new_impl'.format(self.func_name))
-
- def __exit__(self, *args):
- exec('{} = self.old_impl'.format(self.func_name))
-
class InternalTests(unittest.TestCase):
@@ -5743,6 +5723,7 @@ c = ['{0}']
self.build()
self.run_tests()
+
def should_run_cross_arm_tests():
return shutil.which('arm-linux-gnueabihf-gcc') and not platform.machine().lower().startswith('arm')