summaryrefslogtreecommitdiff
path: root/dev-python/mypy/files/mypy-0.782-conftest.patch
blob: 08da1b1b690a8e3a538db113e02edef6887dcbb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
diff --git a/conftest.py b/conftest.py
new file mode 100644
index 00000000..83a6689f
--- /dev/null
+++ b/conftest.py
@@ -0,0 +1,18 @@
+import os.path
+
+pytest_plugins = [
+    'mypy.test.data',
+]
+
+
+def pytest_configure(config):
+    mypy_source_root = os.path.dirname(os.path.abspath(__file__))
+    if os.getcwd() != mypy_source_root:
+        os.chdir(mypy_source_root)
+
+
+# This function name is special to pytest.  See
+# http://doc.pytest.org/en/latest/writing_plugins.html#initialization-command-line-and-configuration-hooks
+def pytest_addoption(parser) -> None:
+    parser.addoption('--bench', action='store_true', default=False,
+                     help='Enable the benchmark test runs')