Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1090)

Unified Diff: third_party/logilab/astroid/brain/py2pytest.py

Issue 753543006: pylint: upgrade to 1.4.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/logilab/astroid/brain/py2mechanize.py ('k') | third_party/logilab/astroid/brain/py2qt4.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/logilab/astroid/brain/py2pytest.py
diff --git a/third_party/logilab/astroid/brain/py2pytest.py b/third_party/logilab/astroid/brain/py2pytest.py
new file mode 100644
index 0000000000000000000000000000000000000000..8165a2ed6fe742de4306eff6b64350d2dc2dbb2f
--- /dev/null
+++ b/third_party/logilab/astroid/brain/py2pytest.py
@@ -0,0 +1,31 @@
+"""Astroid hooks for pytest."""
+
+from astroid import MANAGER, register_module_extender
+from astroid.builder import AstroidBuilder
+
+
+def pytest_transform():
+ return AstroidBuilder(MANAGER).string_build('''
+
+try:
+ import _pytest.mark
+ import _pytest.recwarn
+ import _pytest.runner
+ import _pytest.python
+except ImportError:
+ pass
+else:
+ deprecated_call = _pytest.recwarn.deprecated_call
+ exit = _pytest.runner.exit
+ fail = _pytest.runner.fail
+ fixture = _pytest.python.fixture
+ importorskip = _pytest.runner.importorskip
+ mark = _pytest.mark.MarkGenerator()
+ raises = _pytest.python.raises
+ skip = _pytest.runner.skip
+ yield_fixture = _pytest.python.yield_fixture
+
+''')
+
+register_module_extender(MANAGER, 'pytest', pytest_transform)
+register_module_extender(MANAGER, 'py.test', pytest_transform)
« no previous file with comments | « third_party/logilab/astroid/brain/py2mechanize.py ('k') | third_party/logilab/astroid/brain/py2qt4.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698