mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-12 22:28:59 +02:00
Vendor in Pytest (2.9.2) and its requirement Py (1.4.31), so that it can be used for e.g. the Marionette harness unit tests and a pytest plugin for mozlog. Copy pytest and py package directories (extracted from tars on Pip) into `mozilla-central/python/`, removing some support files (e.g. changelog, docs, tests). Add both `.pth` entries to `virtualenv_packages.txt`. Add both paths to `SEARCH_PATHS` in `mach_bootstrap.py`. MozReview-Commit-ID: IOTCOUxX8R9 --HG-- extra : rebase_source : e03d8a4be084062c0055b365bcc18da6dbb0b7a7
18 lines
415 B
Python
18 lines
415 B
Python
import sys
|
|
|
|
class Std(object):
|
|
""" makes top-level python modules available as an attribute,
|
|
importing them on first access.
|
|
"""
|
|
|
|
def __init__(self):
|
|
self.__dict__ = sys.modules
|
|
|
|
def __getattr__(self, name):
|
|
try:
|
|
m = __import__(name)
|
|
except ImportError:
|
|
raise AttributeError("py.std: could not import %s" % name)
|
|
return m
|
|
|
|
std = Std()
|