Browse Source

Extend more stubs with what we use

Getty Ritter 4 years ago
parent
commit
2c1d33cf99
4 changed files with 13 additions and 4 deletions
  1. 0 0
      stubs/passlib/__init__.py
  2. 6 0
      stubs/passlib/apps.py
  3. 5 4
      stubs/peewee.py
  4. 2 0
      stubs/pytest.py

+ 0 - 0
stubs/passlib/__init__.py


+ 6 - 0
stubs/passlib/apps.py

@@ -0,0 +1,6 @@
+class custom_app_context:
+    @staticmethod
+    def hash(password: str) -> str: pass
+
+    @staticmethod
+    def verify(password: str, hash: str) -> bool: pass

+ 5 - 4
stubs/peewee.py

@@ -28,16 +28,17 @@ class Model:
         pass
 
 
-# These all do things that MyPy chokes on
-def TextField() -> Any:
+# These all do things that MyPy chokes on, so we're going to treat
+# them like methods instead of naming classes
+def TextField(unique: bool = False) -> Any:
     pass
 
 
-def DateTimeField() -> Any:
+def DateTimeField(unique: bool = False) -> Any:
     pass
 
 
-def BooleanField() -> Any:
+def BooleanField(unique: bool = False) -> Any:
     pass
 
 

+ 2 - 0
stubs/pytest.py

@@ -0,0 +1,2 @@
+def raises(e: Exception) -> object:
+    pass