We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72ddf3c commit 2254c78Copy full SHA for 2254c78
tests/conftest.py
@@ -0,0 +1,26 @@
1
+import importlib
2
+import os
3
+
4
+import pytest
5
+import social_core.backends as backends
6
+from social_core.backends.oauth import BaseOAuth2
7
8
+package_path = backends.__path__[0]
9
10
11
+@pytest.fixture
12
+def backends():
13
+ backend_instances = []
14
+ for module in os.listdir(package_path):
15
+ try:
16
+ module_instance = importlib.import_module("social_core.backends.%s" % module[:-3])
17
+ backend_instances.extend([
18
+ attr for attr in module_instance.__dict__.values()
19
+ if type(attr) is type and all([
20
+ issubclass(attr, BaseOAuth2),
21
+ attr is not BaseOAuth2,
22
+ ])
23
24
+ except ImportError:
25
+ continue
26
+ return backend_instances
0 commit comments