Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework test_ctypes #105751

Closed
vstinner opened this issue Jun 13, 2023 · 1 comment
Closed

Rework test_ctypes #105751

vstinner opened this issue Jun 13, 2023 · 1 comment
Labels
tests Tests in the Lib/test dir topic-ctypes type-bug An unexpected behavior, bug, or error

Comments

@vstinner vstinner added the type-bug An unexpected behavior, bug, or error label Jun 13, 2023
@AlexWaygood AlexWaygood added tests Tests in the Lib/test dir topic-ctypes labels Jun 13, 2023
vstinner added a commit to vstinner/cpython that referenced this issue Jun 13, 2023
test_ctypes now gets attributes specific to Windows from the ctypes
module, rather than relying on "from ctypes import *".
vstinner added a commit to vstinner/cpython that referenced this issue Jun 13, 2023
test_ctypes now gets attributes specific to Windows from the ctypes
module, rather than relying on "from ctypes import *".
vstinner added a commit to vstinner/cpython that referenced this issue Jun 13, 2023
test_ctypes now gets attributes specific to Windows from the ctypes
module, rather than relying on "from ctypes import *".
vstinner added a commit to vstinner/cpython that referenced this issue Jun 13, 2023
test_ctypes now gets attributes specific to Windows from the ctypes
module, rather than relying on "from ctypes import *".

Attributes:

* ctypes.WINFUNCTYPE
* ctypes.WinDLL
* ctypes.windll
* ctypes.WinError
* ctypes.get_last_error()
* ctypes.set_last_error()
vstinner added a commit to vstinner/cpython that referenced this issue Jun 13, 2023
test_ctypes now gets attributes specific to Windows from the ctypes
module, rather than relying on "from ctypes import *".

Attributes:

* ctypes.WINFUNCTYPE
* ctypes.WinDLL
* ctypes.windll
* ctypes.WinError
* ctypes.get_last_error()
* ctypes.set_last_error()
vstinner added a commit to vstinner/cpython that referenced this issue Jun 14, 2023
test_ctypes now gets attributes specific to Windows from the ctypes
module, rather than relying on "from ctypes import *".

Attributes:

* ctypes.WINFUNCTYPE
* ctypes.WinDLL
* ctypes.windll
* ctypes.WinError
* ctypes.get_last_error()
* ctypes.set_last_error()
* ctypes.oledll
vstinner added a commit to vstinner/cpython that referenced this issue Jun 14, 2023
test_ctypes now gets attributes specific to Windows from the ctypes
module, rather than relying on "from ctypes import *".

Attributes:

* ctypes.FormatError
* ctypes.WINFUNCTYPE
* ctypes.WinError
* ctypes.WinDLL
* ctypes.windll
* ctypes.oledll
* ctypes.get_last_error()
* ctypes.set_last_error()
vstinner added a commit to vstinner/cpython that referenced this issue Jun 14, 2023
c_ulonglong and c_bool are now always available.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 14, 2023
Moroever, c_ulonglong and c_bool are always available.
vstinner added a commit that referenced this issue Jun 14, 2023
test_ctypes now gets attributes specific to Windows from the ctypes
module, rather than relying on "from ctypes import *".

Attributes:

* ctypes.FormatError
* ctypes.WINFUNCTYPE
* ctypes.WinError
* ctypes.WinDLL
* ctypes.windll
* ctypes.oledll
* ctypes.get_last_error()
* ctypes.set_last_error()
vstinner added a commit that referenced this issue Jun 14, 2023
Moroever, c_ulonglong and c_bool are always available.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 14, 2023
Using "import *" prevents linters like pyflakes to detect symbols
(variables, functions) used being imported.

Replace c_voidp with c_void_p.
vstinner added a commit that referenced this issue Jun 14, 2023
Using "import *" prevents linters like pyflakes to detect undefined names
(usually missing imports).

Replace c_voidp with c_void_p.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 14, 2023
* Replace operator.delitem(obj, index) with "del obj[index]".
* Replace operator.setitem(obj, index, value) with
  "obj[index] = value".
* Replace delattr(obj, "attr) with del obj.attr.
* Replace grc() with sys.getrefcount() for readability.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 14, 2023
* Replace operator.delitem(obj, index) with "del obj[index]".
* Replace operator.setitem(obj, index, value) with
  "obj[index] = value".
* Replace delattr(obj, "attr) with "del obj.attr".
* Replace grc() with sys.getrefcount() for readability.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 14, 2023
Remove most @need_symbol('...') decorator since requested symbols are
now always always available. Use directly the @unittest.skipUnless()
decorator for Windows types:

* ctypes.WINFUNCTYPE
* ctypes.oledll
vstinner added a commit to vstinner/cpython that referenced this issue Jun 14, 2023
Remove most @need_symbol('...') decorator since requested symbols are
now always always available. Use directly the @unittest.skipUnless()
decorator for Windows types:

* ctypes.WINFUNCTYPE
* ctypes.oledll
vstinner added a commit to vstinner/cpython that referenced this issue Jun 14, 2023
Remove most @need_symbol('...') decorator since requested symbols are
now always always available. Use directly the @unittest.skipUnless()
decorator for Windows types:

* ctypes.WINFUNCTYPE
* ctypes.oledll
vstinner added a commit to vstinner/cpython that referenced this issue Jun 14, 2023
Remove the @need_symbol('...') decorator of test.test_ctypes since
requested symbols are now always always available in ctypes.

Use directly the @unittest.skipUnless() decorator for the two types
only available on Windows:

* ctypes.WINFUNCTYPE
* ctypes.oledll
zware pushed a commit that referenced this issue Jun 14, 2023
Remove the @need_symbol('...') decorator of test.test_ctypes since
requested symbols are now always always available in ctypes.

Use the @unittest.skipUnless() decorator directly for the two types
only available on Windows:

* ctypes.WINFUNCTYPE
* ctypes.oledll
zware pushed a commit that referenced this issue Jun 14, 2023
* Replace operator.delitem(obj, index) with "del obj[index]".
* Replace operator.setitem(obj, index, value) with
  "obj[index] = value".
* Replace delattr(obj, "attr) with "del obj.attr".
* Replace grc() with sys.getrefcount() for readability.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 15, 2023
Reenable 3 tests:

* test_overflow()
* test_basic_wstrings()
* test_toolong()

Changes:

* Replace sys.maxint with sys.maxsize
* Replace c_wstring() with create_unicode_buffer()
* Update issue number
vstinner added a commit to vstinner/cpython that referenced this issue Jun 15, 2023
Reenable 3 tests:

* test_overflow()
* test_basic_wstrings()
* test_toolong()
vstinner added a commit to vstinner/cpython that referenced this issue Jun 15, 2023
* Remove "except: print(tp); raise" debug code.
* Remove unused NoNullHandle() function.
* Remove commented code.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 15, 2023
* The following tests were disabled since the initial ctypes commit
  in 2006, commit babddfc:

  * Callbacks.test_char_p()
  * DeletePointerTestCase.test_X()
  * NumberTestCase.test_perf()
  * StructureTestCase.test_subclass_creation()
  * Tests.test_X() of test_byteswap

* NumberTestCase.test_bool_from_address() was disabled in 2007 by
  commit 5dc4fe0.
* Remove check_perf() and run_test() of test_numbers.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 15, 2023
The MACHINE variable is no longer used in test_structures.
vstinner added a commit that referenced this issue Jun 15, 2023
* Remove "except: print(tp); raise" debug code.
* Remove unused NoNullHandle() function.
* Remove commented code.
vstinner added a commit that referenced this issue Jun 15, 2023
Reenable 3 tests:

* test_overflow()
* test_basic_wstrings()
* test_toolong()
vstinner added a commit that referenced this issue Jun 15, 2023
The MACHINE variable is no longer used in test_structures.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 15, 2023
* The following tests were disabled since the initial ctypes commit
  in 2006, commit babddfc:

  * Callbacks.test_char_p()
  * DeletePointerTestCase.test_X()
  * NumberTestCase.test_perf()
  * StructureTestCase.test_subclass_creation()
  * Tests.test_X() of test_byteswap

* NumberTestCase.test_bool_from_address() was disabled in 2007 by
  commit 5dc4fe0.
* Remove check_perf() and run_test() of test_numbers.
vstinner added a commit that referenced this issue Jun 15, 2023
* The following tests were disabled since the initial ctypes commit
  in 2006, commit babddfc:

  * Callbacks.test_char_p()
  * DeletePointerTestCase.test_X()
  * NumberTestCase.test_perf()
  * StructureTestCase.test_subclass_creation()
  * Tests.test_X() of test_byteswap

* NumberTestCase.test_bool_from_address() was disabled in 2007 by
  commit 5dc4fe0.
* Remove check_perf() and run_test() of test_numbers.
carljm added a commit to carljm/cpython that referenced this issue Jun 15, 2023
* main: (57 commits)
  pythongh-105831: Fix NEWS blurb from pythongh-105828 (python#105833)
  pythongh-105820: Fix tok_mode expression buffer in file & readline tokenizer (python#105828)
  pythongh-105751, test_ctypes: Remove disabled tests (python#105826)
  pythongh-105821: Use a raw f-string in test_httpservers.py (python#105822)
  pythongh-105751: Remove platform usage in test_ctypes (python#105819)
  pythongh-105751: Reenable disable test_ctypes tests (python#105818)
  pythongh-105751: Remove dead code in test_ctypes (python#105817)
  More reorganisation of the typing docs (python#105787)
  Improve docs for `typing.dataclass_transform` (python#105792)
  pythonGH-89812: Churn `pathlib.Path` test methods (python#105807)
  pythongh-105800: Issue SyntaxWarning in f-strings for invalid escape sequences (python#105801)
  pythongh-105751: Cleanup test_ctypes imports (python#105803)
  pythongh-105481: add HAS_JUMP flag to opcode metadata (python#105791)
  pythongh-105751: test_ctypes avoids the operator module (pythonGH-105797)
  pythongh-105751: test_ctypes: Remove @need_symbol decorator (pythonGH-105798)
  pythongh-104909: Implement conditional stack effects for macros (python#105748)
  pythongh-75905: Remove test_xmlrpc_net: skipped since 2017 (python#105796)
  pythongh-105481: Fix types and a bug for pseudos (python#105788)
  Update DSL docs for cases generator (python#105753)
  pythonGH-77273: Better bytecodes for f-strings (pythonGH-6132)
  ...
@vstinner
Copy link
Member Author

Ok, I think that I merged enough changes. I close the issue :-)

ambv pushed a commit to ambv/cpython that referenced this issue Jul 31, 2023
…105826)

* The following tests were disabled since the initial ctypes commit
  in 2006, commit babddfc:

  * Callbacks.test_char_p()
  * DeletePointerTestCase.test_X()
  * NumberTestCase.test_perf()
  * StructureTestCase.test_subclass_creation()
  * Tests.test_X() of test_byteswap

* NumberTestCase.test_bool_from_address() was disabled in 2007 by
  commit 5dc4fe0.
* Remove check_perf() and run_test() of test_numbers.
(cherry picked from commit 8f10140)

Co-authored-by: Victor Stinner <vstinner@python.org>
ambv pushed a commit to ambv/cpython that referenced this issue Jul 31, 2023
…105826)

* The following tests were disabled since the initial ctypes commit
  in 2006, commit babddfc:

  * Callbacks.test_char_p()
  * DeletePointerTestCase.test_X()
  * NumberTestCase.test_perf()
  * StructureTestCase.test_subclass_creation()
  * Tests.test_X() of test_byteswap

* NumberTestCase.test_bool_from_address() was disabled in 2007 by
  commit 5dc4fe0.
* Remove check_perf() and run_test() of test_numbers.
(cherry picked from commit 8f10140)

Co-authored-by: Victor Stinner <vstinner@python.org>
ambv added a commit that referenced this issue Jul 31, 2023
…7483)

* The following tests were disabled since the initial ctypes commit
  in 2006, commit babddfc:

  * Callbacks.test_char_p()
  * DeletePointerTestCase.test_X()
  * NumberTestCase.test_perf()
  * StructureTestCase.test_subclass_creation()
  * Tests.test_X() of test_byteswap

* NumberTestCase.test_bool_from_address() was disabled in 2007 by
  commit 5dc4fe0.
* Remove check_perf() and run_test() of test_numbers.
(cherry picked from commit 8f10140)

Co-authored-by: Victor Stinner <vstinner@python.org>
ambv added a commit that referenced this issue Jul 31, 2023
…7484)

* The following tests were disabled since the initial ctypes commit
  in 2006, commit babddfc:

  * Callbacks.test_char_p()
  * DeletePointerTestCase.test_X()
  * NumberTestCase.test_perf()
  * StructureTestCase.test_subclass_creation()
  * Tests.test_X() of test_byteswap

* NumberTestCase.test_bool_from_address() was disabled in 2007 by
  commit 5dc4fe0.
* Remove check_perf() and run_test() of test_numbers.
(cherry picked from commit 8f10140)

Co-authored-by: Victor Stinner <vstinner@python.org>
ambv pushed a commit to ambv/cpython that referenced this issue Jul 31, 2023
…types tests (pythonGH-107460)

(cherry picked from commit 520efec)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
ambv pushed a commit to ambv/cpython that referenced this issue Jul 31, 2023
…types tests (pythonGH-107460)

(cherry picked from commit 520efec)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
ambv added a commit that referenced this issue Jul 31, 2023
…tests (GH-107460) (#107502)

(cherry picked from commit 520efec)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
ambv added a commit that referenced this issue Jul 31, 2023
…tests (GH-107460) (#107501)

(cherry picked from commit 520efec)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-ctypes type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants