summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2020-11-06 15:48:56 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2020-11-07 09:09:19 +0100
commit030aa5f5db380efa73802cb92cb92d156c3dc860 (patch)
treea0b9c6ad75153da4202ab46c8e23cd3b960683ac
parentb60e4030846ee85835c16dcbd1899f2155d90587 (diff)
downloadpygobject-030aa5f5db380efa73802cb92cb92d156c3dc860.tar.gz
tests: Remove metapath hack to import when uninstalled
This was required for Python 2 where Python didn't import our built modules in the build dir because there is no __init__.py. In Python 3 this just works. Tested with setup.py/pytest/meson
-rw-r--r--tests/__init__.py23
1 files changed, 0 insertions, 23 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
index 44068d2c..b96f8a8d 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -5,29 +5,6 @@ import signal
import subprocess
import atexit
import warnings
-import imp
-
-
-class GIImport:
- def find_module(self, fullname, path=None):
- if fullname in ('gi._gi', 'gi._gi_cairo'):
- return self
- return None
-
- def load_module(self, name):
- if name in sys.modules:
- return sys.modules[name]
- fp, pathname, description = imp.find_module(name.split('.')[-1])
- try:
- module = imp.load_module(name, fp, pathname, description)
- finally:
- if fp:
- fp.close()
- sys.modules[name] = module
- return module
-
-
-sys.meta_path.insert(0, GIImport())
def init_test_environ():