pywincffi.dev package¶
Submodules¶
pywincffi.dev.lint module¶
Lint Utilities¶
Provides some help to pylint so static analysis can be made aware of some constants and functions that we define in headers.
-
pywincffi.dev.lint.
constants_in_file
(path)[source]¶ Returns a set of constants in the given file path
-
pywincffi.dev.lint.
functions_in_file
(path)[source]¶ Returns a set of functions defined in the given file path
pywincffi.dev.release module¶
pywincffi.dev.testutil module¶
Test Utility¶
This module is used by the unittests.
-
class
pywincffi.dev.testutil.
LibraryWrapper
(library, attributes)[source]¶ Bases:
object
Used by
TestCase.mock_library()
to replace specific attributes on a compiled library.
Bases:
object
Contains some state data which is shared across multiple
TestCase
instances. This is kept outside of the test case class itself so it can’t be inadvertently modified by a test or fixture.
-
class
pywincffi.dev.testutil.
TestCase
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
A base class for all test cases. By default the core test case just provides some extra functionality.
-
GetLastError
()[source]¶ Returns a tuple containing output from the Windows GetLastError function and the associated error message. The error message will be None if GetLastError() returns 0.
-
HAS_INTERNET
= None¶
-
INTERNET_HOSTS
= ('github.com', 'readthedocs.org', 'example.com')¶
-
INTERNET_PORT
= 80¶
-
REQUIRES_INTERNET
= False¶
-
WSAGetLastError
()[source]¶ Returns a tuple containing output from the Windows WSAGetLastError function and the associated error message. The error message will be None if WSAGetLastError() returns 0.
-
assert_last_error
(errno)[source]¶ This function will assert that the last unhandled error was
errno
. After the check the last error will be reset to zero.Parameters: errno (int) – The expected value from GetLastError.
-
ffi
= None¶
-
kernel32
= None¶
-
maybe_assert_last_error
(errno)[source]¶ This function is similar to
assert_last_error()
except it won’t fail if the current error number is already 0.
-
random_string
(length)[source]¶ Returns a random string as long as
length
. The first character will always be a letter. All other characters will be A-F, A-F or 0-9.
-
unhandled_error_check
()[source]¶ A cleanup step which ensures that there are not any uncaught API errors left over. Unhandled errors could be a sign of an unhandled testing artifact, improper API usage or other problem. In any case, unhandled errors are often a source of test flake.
-
ws2_32
= None¶
-
Module contents¶
Development Sub-Package¶
This package is used for development, testing and release purposes. It
does not contain core functionality of pywincffi and is unused by
pywincffi.core
, pywincffi.kernel32
and other similar modules.